Checks whether an element has a named CSS class.

@param string $className Name of the class

@return bool
969143
public function hasClass($className)
    {
        if ($this->hasAttribute('class')) {
            return in_array($className, preg_split('/\s+/', $this->getAttribute('class')));
        }

        return false;
    }
200095
protected function _strictMode($classname) {
		foreach ($this->_exceptions as $regex) {
			if (preg_match("/{$regex}/", $classname)) {
				return false;
			}
		}
		return true;
	}
500670
protected function isSuffixValid(string $className): bool
    {
        if ($this->isSourcePluginSuffixValid($className)) {
            return true;
        }

        if ($this->isTestPluginSuffixValid($className)) {
            return true;
        }

        return false;
    }
609996
function hasClass(className) {
  var i, val;
  for(i = 0;i < this.length;i++) {
    val = this.get(i).getAttribute(attr);
    val = val ? val.split(/\s+/) : [];
    if(~val.indexOf(className)) {
      return true;
    }
  }
  return false;
}
1065336
public function hasObjectManagerNameByClassName($className)
    {
        $realClass = ClassUtils::getRealClass($className);

        if (array_key_exists($realClass, $this->classNameToObjectManagerName)) {
            return false !== $this->classNameToObjectManagerName[$realClass];
        }

        $moduleOptionsManager =  $this->getModuleOptionsManager();
        if (!$moduleOptionsManager->hasOptionsByClassName($realClass)) {
            $this->classNameToObjectManagerName[$realClass] = false;
            return false;
        }

        $moduleOptions = $moduleOptionsManager->getOptionsByClassName($realClass);

        if (!$moduleOptions instanceof ObjectManagerNameProviderInterface) {
            $this->classNameToObjectManagerName[$realClass] = false;
            return false;
        }

        $objectManagerName = $moduleOptions->getObjectManagerName();

        if (!is_string($objectManagerName)) {
            $this->classNameToObjectManagerName[$realClass] = false;
            return false;
        }
        $this->classNameToObjectManagerName[$realClass] = $objectManagerName;

        return false !== $this->classNameToObjectManagerName[$realClass];
    }
670150
public function detect($className)
    {
        if (!empty($this->cachedRoutes[$className])) {
            return $this->cachedRoutes[$className];
        }
        $this->cachedRoutes[$className] = parent::detect($className);

        return $this->cachedRoutes[$className];
    }
792833
public function removeClass($className)
  {
    $pos = array_search($className, $this->classes);
    if (is_numeric($pos)) {
      unset($this->classes[$pos]);
      return true;
    }
    return false;
  }
70878
public static function getMappedClassName($className)
    {
        $mappedName = array_search($className, self::$classMap);

        if ($mappedName) {
            return $mappedName;
        }

        $mappedName = array_search($className, array_flip(self::$classMap));

        if ($mappedName) {
            return $mappedName;
        }

        return false;
    }
570621
protected function loadClass($className)
    {
        if (strpos($className, NS) !== false) {
            $className = str_replace(NS, DS, ltrim($className, NS));
        }

        $filename = str_replace('_', DS, $className) . '.php';

        if (array_key_exists($className, $this->includePaths)) {
            @require_once $this->includePaths[$className];

            if (class_exists('\\' . trim("$className", '\\'))) {
                return true;
            }
        }

        foreach ($this->includePaths as $namespace => $includePath) {
            if (file_exists($includePath . $filename)) {
                require_once $includePath . $filename;

                return true;
            }
        }

        return false;
    }
518075
function hasClass(element, className) {
    var hasClass = true;
    nodesToArray(element).forEach(function (node) {
        if (!node.classList.contains(className)) {
            hasClass = false;
        }
    });
    return hasClass;
}
130739
public function loadClass($className) {
        $cache = $this->getCache();
        $entries = $cache->load($this->cacheKey);
        if($entries == false) {
            $entries = array();
        }
        $status = $this->tryAndLoadClass($className, $entries);
        if($status) {
            // class loaded
            return true;
        }
        if(preg_match($this->ignoreClassNamesRegexp, $className)) {
            return false;
        }
 
        foreach($this->classPaths as $path) {
            // Scan for file
            $realPath = $this->searchForClassFile($className, $path);
            if($realPath !== false) {
                $entries[$className] = $realPath;
                break;
            }
        }
        $cache->save($entries, $this->cacheKey);
        $status = $this->tryAndLoadClass($className, $entries);
        return $status;
    }
509790
public static function classExists($className, $namespace)
    {
        if (class_exists($className)) {
            return $className;
        }

        // add namespace
        $className = sprintf('%s%s', static::getFormatNamespace($namespace, true), $className);

        if (class_exists($className)) {
            return $className;
        }

        return false;
    }
938535
public function hasClass($className)
    {
        if(strlen($className) < 1)
        {
            throw new HTMLTagException("Class name is empty");
        }

        if($this->hasAttribute("class"))
        {
            $classes = $this->getClasses();

            foreach(explode(" ",$classes) as $class) {
                if(strtolower($class) == strtolower($className)) {
                    return true;    // We found it.
                }
            }

        }

        return false;
    }
679046
public function isTransient($className)
    {
        $fileName = str_replace('\\', '.', $className) . $this->fileExtension;

        // Check whether file exists
        foreach ((array) $this->paths as $path) {
            if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
                return false;
            }
        }

        return true;
    }
164485
public function isClassAnnotatedWith($className, $annotationClassName)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        $className = $this->cleanClassName($className);

        $annotationClassName = $this->cleanClassName($annotationClassName);

        return (isset($this->annotatedClasses[$annotationClassName][$className]));
    }
571845
public function isMethodProtected($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return (isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_VISIBILITY]) && $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_VISIBILITY] === self::VISIBILITY_PROTECTED);
    }
871315
function hasClass(element, className) {
    !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0;
    if (element.classList) {
      return !!className && element.classList.contains(className);
    }
    return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
  }