Tests if node is valid

@param      ChildCategory $node    Propel object for src node
@return     bool
968293
static public function isValid(ChildCategory $node = null)
    {
        if (is_object($node) && $node->getRightValue() > $node->getLeftValue()) {
            return true;
        } else {
            return false;
        }
    }
960241
public function matches(\Neos\ContentRepository\Domain\Model\NodeData $node)
    {
        $nodeIsMatchingNodeType = false;

        for($i=0; $i<$this->searchDepth;$i++){
            $parentNode = $node->getParent();

            if($parentNode!==null){
                // This will break atm for NodeTypes that no longer exist - see /Packages/Application/Neos.ContentRepository/Classes/TYPO3/TYPO3CR/Migration/Filters/NodeType.php
                // version stated there is a "hack" though and does not allow for standard UnitTesting
                $nodeType = $parentNode->getNodeType();

                if ($this->withSubTypes === true) {
                    $nodeIsMatchingNodeType = $nodeType->isOfType($this->nodeTypeName);
                } else {
                    if ($nodeType->getName() === $this->nodeTypeName) {
                        $nodeIsMatchingNodeType = true;
                        break;
                    }
                }
                $node = $parentNode;
            }
            else{
                break;
            }
        }

        return $nodeIsMatchingNodeType;
    }
1169839
private function isIncludeThrowableNode(Node $node): bool
    {
        foreach ($node->children['class']->children as $class) {
            if ($class->children['name'] === 'Throwable') {
                return true;
            }
        }

        return false;
    }
681719
public function appliesTo(Node $node)
    {
        if ($node->wasCancelled()
            && $this->result == self::NODE_RESULT_CANCEL
        ) {
            return true;
        } elseif ($node->isComplete()
            && $this->result == self::NODE_RESULT_COMPLETE
            && (!isset($this->data['input'])
                || $this->data['input'] == $node->getInput()
                )
        ) {
            return true;
        } elseif ($node->maxInputsReached()
            && $this->result == self::NODE_RESULT_MAX_ATTEMPTS_REACHED
        ) {
            return true;
        }
        return false;
    }
1013120
protected function isEntity(ClassNode $node)
    {
        $docComment = $node->getDocComment();

        if (0 < preg_match($this->getStringProperty('classIsEntityRegex'), $docComment)) {
            return true;
        }

        if (true === $node->isAbstract()) {
            return false;
        }

        if (0 < preg_match($this->getStringProperty('entityRegex'), $docComment)) {
            return true;
        }

        return false;
    }
1336639
private function validateNode($node, CustomArrayObject $schema, $element = [])
    {
        $nodeSchema = new CustomArrayObject($schema[$node]);

        foreach ($nodeSchema->getArrayKeys() as $key) {
            $this->currentNode = $node . '.' . $key;
            $this->getLogger()->info("We are in element: {$this->currentNode}");

            $nodeData = isset($element[$key]) ? $element[$key] : null;


            $this->validateTypeFieldIsPresent($nodeSchema[$key]);

            $validator = $this->getClassValidator($nodeSchema[$key]);
            $validator->setParams($this->params);

            $isRequired = $this->requiredMode ? $validator->isRequired() : false;

            if ($isRequired === false && empty($nodeData)) {
                $this->getLogger()->info("Element: {$this->currentNode} has empty non-required data. We skip other check");
                continue;
            }

            $this->validateRequiredFieldIsPresent($nodeData);

            $this->validateExcessiveKeys($validator, new CustomArrayObject($nodeSchema[$key]), $nodeData);

            $this->validateNodeValue($validator, $nodeData);

            $this->validateNesting($validator, $nodeData);

            if ($validator->isNested()) {
                $this->getLogger()->info("Element: {$this->currentNode} has children");

                foreach ($nodeData as $record) {
                    $this->validateNode($key, $nodeSchema, $record);
                }
            } else {
                $this->validateNode($key, $nodeSchema, $nodeData);
            }

            $this->getLogger()->info("Element: {$this->currentNode} finished checking successfully.");
        }
    }
969864
public function addNode(Node $node): bool {
        $added = $this->add($node->getKey(), $node->getValue());
        return $added;
    }
102386
private function canSubmitForm(\DOMElement $node)
    {
        $type = $node->hasAttribute('type') ? $node->getAttribute('type') : null;

        if ('input' === $node->nodeName && in_array($type, array('submit', 'image'), true)) {
            return true;
        }

        return 'button' === $node->nodeName && (null === $type || 'submit' === $type);
    }
510534
private function isClassFullyQualifiedName(Node $node): bool
    {
        $parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
        if ($parentNode === null) {
            return false;
        }

        if (! $parentNode instanceof New_) {
            return false;
        }

        /** @var FullyQualified $fullyQualifiedNode */
        $fullyQualifiedNode = $parentNode->class;

        $newClassName = $fullyQualifiedNode->toString();

        return array_key_exists($newClassName, $this->oldToNewNamespaces);
    }
260971
public function leaveNode(Node $node)
    {
        if ($node instanceof Stmt\Use_
            || $node instanceof Stmt\GroupUse
        ) {
            return false;
        }
    }
724847
protected function hasDeprecatedDocComment(Node $node)
    {
        try {
            $docBlock = new DocBlock((string) $node->getDocComment());

            return count($docBlock->getTagsByName('deprecated')) > 0;
        } catch (\Exception $e) {
            return false;
        }
    }
550079
protected function isRed(?RedBlackNode $node): bool
    {
        if ($node === null) {
            return false;
        }

        return $node->color() === RedBlackNode::RED;
    }
868978
public function nodeExists($path)
    {
        try {
            // The root always exists
            if ('' === $path) {
                return true;
            }

            list($parent, $base) = Uri\split($path);

            $parentNode = $this->getNodeForPath($parent);
            if (!$parentNode instanceof ICollection) {
                return false;
            }

            return $parentNode->childExists($base);
        } catch (Exception\NotFound $e) {
            return false;
        }
    }
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();
    }
589123
public function checkPermissions($node) {
    switch ($node->getType()) {
      case 'campaign':
        $campaign = $node;
        break;

      case 'campaign_page':
        $campaign = $this->getCampaignNodeFromRoute();
        break;

      default:
        return FALSE;
    }

    // Get full menu from the Campaign node.
    $campaignMenu = $campaign->get('field_campaign_menu')->getValue();
    if (!empty($campaignMenu)) {
      $campaignMenu = unserialize($campaign->field_campaign_menu->value);
    }

    if (empty($campaignMenu)) {
      return FALSE;
    }

    $landingPage = $this->getActiveCampaignPage($campaign);

    // Show Pause page without the permissions check.
    if ($campaign->get('field_pause_campaign')->value) {
      return TRUE;
    }

    if ($node->getType() == 'campaign') {
      $pageId = $landingPage->id();
    }
    else {
      $pageId = $node->id();
    }
    foreach ($campaignMenu[$landingPage->id()]['links'] as $k => $link) {
      if (empty($link['page'])) {
        continue;
      }
      $linkPageId = $link['page'][0]['target_id'];
      if ($linkPageId != $pageId) {
        continue;
      }
      return !$link['logged'] || MemberCampaign::isLoggedIn($campaign->id());

      break;
    }
    return FALSE;
  }
176942
public function is($node)
    {
        if ($node instanceof Element) {
            $node = $node->getNode();
        }

        if (!$node instanceof DOMNode) {
            throw new InvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s or DOMNode, %s given', __METHOD__, __CLASS__, (is_object($node) ? get_class($node) : gettype($node))));
        }

        return $this->node->isSameNode($node);
    }
24730
private function isChildOfTry(AbstractNode $node)
    {
        $parent = $node->getParent();

        while (is_object($parent)) {
            if ($parent->isInstanceOf('TryStatement')) {
                return true;
            }

            $parent = $parent->getParent();
        }

        return false;
    }