@param array $classNames

@return \DiDom\ClassAttribute

@throws \InvalidArgumentException if class name is not a string
501048
public function addMultiple(array $classNames)
    {
        $this->parseClassAttribute();

        foreach ($classNames as $className) {
            if (!is_string($className)) {
                throw new InvalidArgumentException(sprintf('Class name must be a string, %s given', (is_object($className) ? get_class($className) : gettype($className))));
            }

            if (in_array($className, $this->classes, true)) {
                continue;
            }

            $this->classes[] = $className;
        }

        $this->updateClassAttribute();

        return $this;
    }
1257369
protected function buildAttributes($options, $classes)
    {
        $attributes = [];
        $attributes[] = 'class="'.$classes.'"';

        unset($options['class']);

        if (is_array($options)) {
            foreach ($options as $attribute => $value) {
                $attributes[] = $this->createAttribute($attribute, $value);
            }
        }

        return (count($attributes) > 0) ? implode(' ', $attributes) : '';
    }
928265
protected function prepareClasses(array $classes)
    {
        \natcasesort($classes);

        // My kingdom for a generator.
        $ret = [];

        foreach ($classes as $name) {
            if ($this->showItem($name)) {
                $ret[$name] = [
                    'name'  => $name,
                    'style' => self::IS_CLASS,
                    'value' => $this->presentSignature($name),
                ];
            }
        }

        return $ret;
    }
405715
public static function getClassProfile($classname) {
		if (!is_string($classname) || empty($classname)) {
			throw new \InvalidArgumentException("Argument is not a valid class name");
		}
		
		//check if is already stored
		if (array_key_exists($classname, self::$profiles)) {
			return self::$profiles[$classname];
		}
		
		//validate classname
 		if (!class_exists($classname, true)) {
 			throw new \RuntimeException("Class %s could not be found");
 		}
		
		//build profile and return
		self::$profiles[$classname] = new ClassProfile($classname);
		return self::$profiles[$classname];
	}
953823
public function hasAttributeClass($className)
    {
        if ( ! $this->offsetExists('class')) {
            $this->storage[ 'class' ] = [];
        }

        return in_array($className, $this->storage[ 'class' ]);
    }
99453
public function addClass($classname)
    {
        $classArr = $this->getClassArray();
        $classArr[] = $classname;
        return $this->setClassArray($classArr);
    }
1301585
public function defaults(array $defaults = [])
    {
        $definition = $this->getDefinition();

        foreach ($defaults as $name => $default) {
            if ($definition->hasArgument($name)) {
                $input = $definition->getArgument($name);
            } elseif ($definition->hasOption($name)) {
                $input = $definition->getOption($name);
            } else {
                throw new \InvalidArgumentException(
                    "Unable to set default for [{$name}]. It does not exist as an argument or option."
                );
            }

            $input->setDefault($default);
        }

        return $this;
    }
1371096
public function setParentClasses(array $classNames)
    {
        $this->parentClasses = $classNames;

        if (count($classNames) > 0) {
            $this->rootDocumentName = array_pop($classNames);
        }
    }
1192640
public function removeMultipleProperties(array $propertyNames)
    {
        $this->parseStyleAttribute();

        foreach ($propertyNames as $propertyName) {
            if (!is_string($propertyName)) {
                throw new InvalidArgumentException(sprintf('Property name must be a string, %s given', (is_object($propertyName) ? get_class($propertyName) : gettype($propertyName))));
            }

            unset($this->properties[$propertyName]);
        }

        $this->updateStyleAttribute();

        return $this;
    }
53273
private static function setAjaxAttributes($classname)
    {
        self::$staticAttributes = app($classname)->getAttributes();
        $width                  = Input::get('width');
        if ($width) {
            $width = (int) (12 * $width) / 100;
            array_set(self::$staticAttributes, 'width', $width);
        }
        $height = Input::get('height');
        if ($height) {
            $height = (int) (12 * $height) / 100;
            array_set(self::$staticAttributes, 'height', $height);
        }
        return self::$staticAttributes;
    }
83159
public function getFirstAncestor(...$classNames) {
        $ancestor = $this;
        while (($ancestor = $ancestor->parent) !== null) {
            foreach ($classNames as $className) {
                if ($ancestor instanceof $className) {
                    return $ancestor;
                }
            }
        }
        return null;
    }
134870
public function class($classes): Htmlable
    {
        if ($classes instanceof Collection) {
            $classes = $classes->toArray();
        }

        $attributes = new Attributes();
        $attributes->addClass($classes);

        return new HtmlString(
            $attributes->render()
        );
    }
269806
public function setParentClassNames(array $classNames)
    {
        $this->parentClassNames = $classNames;

        if (count($classNames) > 0) {
            $this->rootDocumentName = array_pop($classNames);
        }
    }
317641
public function getFirstDescendantNode(...$classNames) {
        foreach ($this->getDescendantNodes() as $descendant) {
            foreach ($classNames as $className) {
                if ($descendant instanceof $className) {
                    return $descendant;
                }
            }
        }
        return null;
    }
648014
public function parseClassAnnotations(string $className, array $annotations)
    {
        if (!$this->isParseClass($annotations)) {
            return null;
        }

        $beanData = null;
        foreach ($annotations as $annotation) {
            $annotationClass = get_class($annotation);
            if (!in_array($annotationClass, $this->getClassAnnotations())) {
                continue;
            }

            // annotation parser
            $annotationParser = $this->getAnnotationParser($annotation);
            if ($annotationParser == null) {
                continue;
            }
            $annotationData = $annotationParser->parser($className, $annotation);
            if ($annotationData != null) {
                $beanData = $annotationData;
            }
        }

        return $beanData;
    }
1212843
public function add($className)
    {
        if (!is_string($className)) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be string, %s given', __METHOD__, (is_object($className) ? get_class($className) : gettype($className))));
        }

        $this->parseClassAttribute();

        if (in_array($className, $this->classes, true)) {
            return $this;
        }

        $this->classes[] = $className;

        $this->updateClassAttribute();

        return $this;
    }
382001
public static function resolve($classname, array $context)
    {
        if ($classname[0] === '\\') {
            return substr($classname, 1);
        }
        $cn = explode(':', $classname, 2);
        if (count($cn) === 1) {
            if (!empty($context['namespace'])) {
                $classname = $context['namespace'].$classname;
            }
            return $classname;
        }
        $module = $cn[0];
        $cn = $cn[1];
        if (!empty($context['modules'])) {
            $modules = $context['modules'];
            if (isset($modules[$module])) {
                return $modules[$module].'\\'.$cn;
            }
        }
        if (!empty($context['moduleResolver'])) {
            $cn = Callback::call($context['moduleResolver'], [$module, $cn]);
            if (is_string($cn)) {
                return $cn;
            }
        }
        throw new InvalidPointer($classname);
    }