@param \PHPMD\Node\ClassNode $classNode

@return bool
190756
protected function isZedNamespace(ClassNode $classNode): bool
    {
        $classNamespace = $classNode->getNamespaceName();

        if (!preg_match(static::PATTERN_NAMESPACE_APPLICATION_ZED, $classNamespace)) {
            return false;
        }

        return true;
    }
842613
public function removeClass($class_name='')
    {
        $remove_names = \is_array($class_name) ? $class_name : explode(' ', $class_name);

        foreach ($this->nodes as $node) {
            if ($node instanceof \DOMElement && $node->hasAttribute('class')) {
                $node_classes = preg_split('#\s+#s', $node->getAttribute('class'));
                $class_removed = false;

                if ($class_name === '') { // remove all
                    $node_classes = array();
                    $class_removed = true;
                } else {
                    foreach ($remove_names as $remove_name) {
                        $key = array_search($remove_name, $node_classes, true);
                        if ($key !== false) {
                            unset($node_classes[$key]);
                            $class_removed = true;
                        }
                    }
                }
                if ($class_removed) {
                    $node->setAttribute('class', implode(' ', $node_classes));
                }
            }
        }

        return $this;
    }
794375
static public function hasClass(DOMElement $node, $class)
    {
        if (is_array($class) === false) {
            $class = array($class);
        }

        $attr = explode("\x20", $node->getAttribute('class'));

        foreach ($class as $c) {
            if (in_array($c, $attr) === false) {
                return false;
            }
        }

        return true;
    }
992408
public function classFileExists($classFile)
    {
        if (file_exists($classFile)) {
            return true;
        }
        foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
            if (file_exists($path) && file_exists($path.DIRECTORY_SEPARATOR.$classFile)) {
                return true;
            }
        }
        return false;
    }
848872
private function removeSelfTypeMethod(Class_ $node): Class_
    {
        foreach ((array) $node->stmts as $key => $stmt) {
            if (! $stmt instanceof ClassMethod) {
                continue;
            }

            if (count((array) $stmt->stmts) !== 1) {
                continue;
            }

            $innerClassMethodStmt = $stmt->stmts[0] instanceof Expression ? $stmt->stmts[0]->expr : $stmt->stmts[0];

            if (! $innerClassMethodStmt instanceof MethodCall) {
                continue;
            }

            if (! $this->isName($innerClassMethodStmt, 'shouldHaveType')) {
                continue;
            }

            // not the tested type
            if (! $this->isValue($innerClassMethodStmt->args[0]->value, $this->testedClass)) {
                continue;
            }

            // remove it
            unset($node->stmts[$key]);
        }

        return $node;
    }
792833
public function removeClass($className)
  {
    $pos = array_search($className, $this->classes);
    if (is_numeric($pos)) {
      unset($this->classes[$pos]);
      return true;
    }
    return false;
  }
1314771
protected function verifyClass(AbstractNode $node, array $namespaceParts): void
    {
        $expectedBridgeNameRegexp = '#^' . $namespaceParts['moduleName'] . 'To[\w]+' . $namespaceParts['layerName'] . 'Bridge$#';

        if (preg_match($expectedBridgeNameRegexp, $node->getName()) !== 0) {
            return;
        }

        $message = sprintf(
            'The bridge name is not \'%sTo{target_module_name}%sBridge\'. That violates the rule "%s"',
            $namespaceParts['moduleName'],
            $namespaceParts['layerName'],
            static::CLASS_RULE
        );

        $this->addViolation($node, [$message]);
    }
1098066
public function hasClass($className)
    {
        if (!$class = $this->dom->getAttribute("class")) {
            return false;
        }

        $classes = explode(" ", $class);

        return in_array($className, $classes, true);
    }
84519
public function remove_class($class) {
        if (in_array($class, $this->classes)) {
            $key = array_search($class,$this->classes);
            if ($key!==false) {
                unset($this->classes[$key]);
                return true;
            }
        }
        return false;
    }
68970
public function hasClassProperty($class)
    {
        if (! is_array($class)) {
            $class = func_get_args();
        }

        if (isset($this->htmlAttributes['class']) && is_array($this->htmlAttributes['class'])) {
            foreach ($this->htmlAttributes['class'] as $i => $string) {
                foreach ($class as $className) {
                    if (strpos($string, $className) !== false) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
193471
public function addNode(string $className): void
    {
        if (isset($this->nodes[$className])) {
            return;
        }

        $this->nodes[$className] = new DocumentGraphNode($className);
    }
13847
protected function verifyClass(ClassNode $node, InterfaceNode $interfaceNode): void
    {
        $classMethods = $node->getMethods();
        $interfaceMethods = $interfaceNode->getMethods();

        $notMatchingMethods = $this->findNotMatchingMethodsForBridgeClass($classMethods, $interfaceMethods);

        foreach ($notMatchingMethods as $notMatchingMethod) {
            $message = sprintf(
                'The bridge has incorrect method \'%s\' signature. That violates the rule "%s"',
                $notMatchingMethod->getName(),
                static::RULE
            );

            $this->addViolation($node, [$message]);
        }
    }
1207285
protected function hasChanged($classFile)
    {
        $className = $this->className($classFile);
        $cacheFile = $this->cacheFile($className);
        $cacheDate = file_exists($cacheFile) ? filemtime($cacheFile) : 0;
        $fileDate  = filemtime($classFile);

        return ($fileDate != $cacheDate);
    }
106421
public function isAction(Node $node): bool
    {
        if (! $node instanceof ClassMethod) {
            return false;
        }

        $parentClassName = (string) $node->getAttribute(AttributeKey::PARENT_CLASS_NAME);
        if (Strings::endsWith($parentClassName, 'Controller')) {
            return true;
        }

        if (Strings::endsWith((string) $node->name, 'Action')) {
            return true;
        }

        return $node->isPublic();
    }
264376
public function isClass($className)
    {
        foreach ($this->definitions as $key => $value) {
            if (!strcasecmp($key, $className) && 'class' === $value->getType()) {
                return true;
            }
        }

        /*
         * Try to autoload the class from an external dependency
         */
        if (\count($this->externalDependencies)) {
            foreach ($this->externalDependencies as $namespace => $location) {
                if (preg_match('#^'.$namespace.'\\\\#i', $className)) {
                    return $this->loadExternalClass($className, $location);
                }
            }
        }

        return false;
    }
369532
protected function isDeclaration(ParentNode $node) {
    return $node instanceof FunctionDeclarationNode ||
      $node instanceof SingleInheritanceNode ||
      $node instanceof InterfaceNode ||
      $node instanceof ClassMethodNode ||
      $node instanceof InterfaceMethodNode;
  }
666088
private function validateConstructor(Node $constructor, Node $classNode)
    {
        if ($constructor->isStatic()) {
            // For PHP Parser 4.x
            $className = $classNode->name instanceof Identifier ? $classNode->name->toString() : $classNode->name;

            $msg = \sprintf(
                'Constructor %s::%s() cannot be static',
                \implode('\\', \array_merge($this->namespace, (array) $className)),
                $constructor->name
            );
            throw new FatalErrorException($msg, 0, E_ERROR, null, $classNode->getLine());
        }

        if (\method_exists($constructor, 'getReturnType') && $constructor->getReturnType()) {
            // For PHP Parser 4.x
            $className = $classNode->name instanceof Identifier ? $classNode->name->toString() : $classNode->name;

            $msg = \sprintf(
                'Constructor %s::%s() cannot declare a return type',
                \implode('\\', \array_merge($this->namespace, (array) $className)),
                $constructor->name
            );
            throw new FatalErrorException($msg, 0, E_ERROR, null, $classNode->getLine());
        }
    }