src/Document.php
public function addClass($class)
    {
        if (!is_string($class)) {
            $exMsg = sprintf('Provided class `%s` is not a string', $class);
            throw new LogicException($exMsg);
        }

        $currentClass = $this->getClass();
        if (in_array($class, $currentClass)) {
            $exMsg = sprintf('Provided class `%s` is already registered', $class);
            throw new LogicException($exMsg);
        }

        $this->class[] = $class;

        return $this;
    }
public function addClass($class)
    {
        if (!is_string($class)) {
            $exMsg = sprintf('Provided class `%s` is not a string', $class);
            throw new LogicException($exMsg);
        }

        $currentClass = $this->getClass();
        if (in_array($class, $currentClass)) {
            $exMsg = sprintf('Provided class `%s` is already registered', $class);
            throw new LogicException($exMsg);
        }

        $this->class[] = $class;

        return $this;
    }
Add class

@param string $class
@return $this
@throws LogicException