Checks if a node is red

@param RedBlackNode|null $node The node

@return bool
550079
protected function isRed(?RedBlackNode $node): bool
    {
        if ($node === null) {
            return false;
        }

        return $node->color() === RedBlackNode::RED;
    }
1296471
protected function nodeCeiling($key, ?RedBlackNode $node): ?RedBlackNode
    {
        if ($node === null) {
            return null;
        }

        $comp = $this->comparator->compare($key, $node->key());

        if ($comp === 0) {
            return $node;
        }
        if ($comp > 0) {
            return $this->nodeCeiling($key, $node->right());
        }
        $left = $this->nodeCeiling($key, $node->left());
        if ($left !== null) {
            return $left;
        }

        return $node;
    }
704938
public function red($red = null)
    {
        if ($red !== null) {
            $this->validateAndSet('red', $red);
            return $this;
        }
        return !empty($this->castsInteger) ? (int) $this->red : $this->red;
    }
1142703
public function removeNode(RiakNode $node)
    {
        $index  = array_search($node, $this->nodes);
        $result = isset($this->nodes[$index]) ? $this->nodes[$index] : null;

        if ($result === null) {
            return;
        }

        unset($this->nodes[$index]);

        return $result;
    }
231507
protected function flipColors(RedBlackNode $node): void
    {
        $node->setColor(!($node->color()));
        $node->left()->setColor(!($node->left()->color()));
        $node->right()->setColor(!($node->right()->color()));
    }
934381
protected function processNodeResult(Node $node)
    {
        $ret = false;
        $name = $node->getName();
        if (isset($this->nodeResults[$name])) {
            foreach ($this->nodeResults[$name] as $resultInfo) {
                /* @var $resultInfo NodeActionCommand */
                if ($resultInfo->appliesTo($node)) {
                    if ($resultInfo->isActionHangup()) {
                        $this->logDebug("Hanging up after $name");
                        $this->client->hangup();
                    } elseif ($resultInfo->isActionJumpTo()) {
                        $data = $resultInfo->getActionData();
                        if (isset($data['nodeEval'])) {
                            $callback = $data['nodeEval'];
                            $nodeName = $callback($node);
                        } else {
                            $nodeName = $data['nodeName'];
                        }
                        $this->logDebug("Jumping from $name to $nodeName");
                        $ret = $nodeName;
                        break;
                    } elseif ($resultInfo->isActionExecute()) {
                        $this->logDebug("Executing callback after $name");
                        $data = $resultInfo->getActionData();
                        $callback = $data['callback'];
                        $callback($node);
                    }
                }
            }
        }
        return $ret;
    }
927665
protected function findNodeIndex(Node $node)
    {

        foreach ($this->data as $i=>$added) {
            if ($added->getId() == $node->getId()) {
                return $i;
            }
        }

        // Not found? try it by spl_object_hash
        $nodeHash = spl_object_hash($node);

        foreach ($this->data as $i=>$added) {
            if (spl_object_hash($added) == $nodeHash) {
                return $i;
            }
        }

        return null;

    }
314283
public function hasType(Node $node = null, $type) {
        if (!isset($node))
            return false;
        $type = $this->expand($type);
        $typesFromNode = $node->getType();
        if (!isset($typesFromNode))
            return false;
        if (is_array($typesFromNode)) {
            foreach ($typesFromNode as $t)
                if (is_a($t, 'ML\JsonLD\Node')
                    && $t->getId() == $type)
                return true;
        } else
        if (is_a($typesFromNode, 'ML\JsonLD\Node')
                && $typesFromNode->getId() == $type)
            return true;
        else
            return false;
        
        return false;
    }
165415
public function isNullableType(Node $node): bool
    {
        $nodeType = $this->getNodeStaticType($node);
        if (! $nodeType instanceof UnionType) {
            return false;
        }

        return $nodeType->isSuperTypeOf(new NullType())->yes();
    }
892957
private function isIncludeExceptionNode(Node $node): bool
    {
        foreach ($node->children['class']->children as $class) {
            if ($class->children['name'] === 'Exception') {
                return true;
            }
        }

        return false;
    }
188788
protected function nodeGet($key, ?RedBlackNode $node): ?RedBlackNode
    {
        while ($node !== null) {
            $comp = $this->comparator->compare($key, $node->key());
            if ($comp < 0) {
                $node = $node->left();
            } elseif ($comp > 0) {
                $node = $node->right();
            } else {
                return $node;
            }
        }

        return null;
    }
1304749
public void remove(Node<T> node) {
    	if (first == node) {
    		removeMin();
    		return;
    	}
    	if (last == node) {
    		removeMax();
    		return;
    	}
    	// if both children of root are black, set root to red
    	if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red))
            root.red = true;

        root = remove(root, node);
        if (root != null) root.red = false;
        else first = last = null;
    }
1028879
public function isMarked(DataObject $node)
    {
        $id = $node->ID ?: 0;
        return !empty($this->markedNodes[$id]);
    }
579366
public function isTreeOpened(DataObject $node)
    {
        $id = $node->ID ?: 0;
        return !empty($this->treeOpened[$id]);
    }
308632
protected function rotateLeft(RedBlackNode $node): RedBlackNode
    {
        $link = $node->right();
        $node->setRight($link->left());
        $link->setLeft($node);
        $link->setColor($node->color());
        $node->setColor(RedBlackNode::RED);
        $link->setSize($node->size());
        $node->setSize(1 + $this->nodeSize($node->left()) + $this->nodeSize($node->right()));

        return $link;
    }
1178866
public function renderItem(&$node)
    {
        $type = $node[0];
        $item = $this->loadItemType($type);

        if ($item === false) {
            return null;
        }

        return $item->render($node);
    }
133619
private function isOurNode($node)
    {
        foreach ($this->createdNodes as $createdNode) {
            if ($createdNode == $node) {
                return true;
            }
        }
        return false;
    }