@param Property $node

@return RefProperty
166932
private function createProperty(Property $node)
    {
        $ref = new RefProperty();

        $ref->class   = $this->class;
        $ref->name    = (string)$node->props[0]->name;
        $ref->default = $this->getValue($node->props[0]->default);

        if ($node->isPrivate()) {
            $ref->visibility = Visibility::IS_PRIVATE;
        } elseif ($node->isProtected()) {
            $ref->visibility = Visibility::IS_PROTECTED;
        } elseif ($node->isPublic()) {
            $ref->visibility = Visibility::IS_PUBLIC;
        }

        $ref->isStatic   = $node->isStatic();
        $ref->line       = $node->getLine();
        $ref->docComment = $this->createDocComment($node);

        return $ref;
    }
1298484
public function enterNode(Node $node)
    {
        // @todo support MethodCall and StaticCall as well.
        if ($node instanceof FuncCall) {
            // if function name is an expression or a variable, give it a pass for now.
            if ($node->name instanceof Expr || $node->name instanceof Variable) {
                return;
            }

            $name = (string) $node->name;

            if ($name === 'array_multisort') {
                return $this->validateArrayMultisort($node);
            }

            try {
                $refl = new \ReflectionFunction($name);
            } catch (\ReflectionException $e) {
                // Well, we gave it a shot!
                return;
            }

            foreach ($refl->getParameters() as $key => $param) {
                if (\array_key_exists($key, $node->args)) {
                    $arg = $node->args[$key];
                    if ($param->isPassedByReference() && !$this->isPassableByReference($arg)) {
                        throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, E_ERROR, null, $node->getLine());
                    }
                }
            }
        }
    }
302104
private function createDocComment(Node $node)
    {
        $docComment = $node->getDocComment();
        if (!$docComment) {
            return null;
        }

        $ref            = new RefComment();
        $ref->text      = $docComment->getText();
        $ref->startLine = $docComment->getLine();
        $ref->endLine   = $node->getLine() - 1;

        return $ref;
    }
553843
public function setNode(\Coral\ContentBundle\Entity\Node $node)
    {
        $this->node = $node;

        return $this;
    }
1331885
public function getNodeAttributes(Node $node) {
        // Extract the properties of the node
        $attributes = $node->getProperties();

        // Add the node id to the attributes since \\Orientdb\Node
        // does not consider it to be a property, it is treated differently
        // and available through the getId() method.
        $attributes[$this->model->getKeyName()] = $node->getId();

        return $attributes;
    }
1300671
protected function renderNodePropertyAttribute(NodeInterface $node, $propertyName)
    {
        $attributes = [];
        /** @var $contentContext ContentContext */
        $contentContext = $node->getContext();
        // skip the node name of the site node - TODO: Why do we need this?
        if ($propertyName === '_name' && $node === $contentContext->getCurrentSiteNode()) {
            return $attributes;
        }

        $dataType = $node->getNodeType()->getPropertyType($propertyName);
        $dasherizedPropertyName = $this->dasherize($propertyName);

        $propertyValue = $this->nodePropertyConverterService->getProperty($node, $propertyName);
        $propertyValue = $propertyValue === null ? '' : $propertyValue;
        $propertyValue = !is_string($propertyValue) ? json_encode($propertyValue) : $propertyValue;

        if ($dataType !== 'string') {
            $attributes['data-nodedatatype-' . $dasherizedPropertyName] = 'xsd:' . $dataType;
        }

        $attributes['data-node-' . $dasherizedPropertyName] = $propertyValue;

        return $attributes;
    }
128579
private function addVariableReference(Node\Expr\AssignRef $node)
    {
        $scope = $this->getCurrentScope();

        /**
         * If the reference is assigned to an object property, the warning is not relevant,
         * because the user probably expects the assigned property to be modified.
         */
        $isAssignedToVariable = $node->var instanceof Node\Expr\Variable;
        if (!$scope || !$isAssignedToVariable) {
            return array();
        }

        $fromVariableName = $this->convertVariableNameToString($node->expr);
        $toVariableName = $this->convertVariableNameToString($node->var);

        $scope = $this->getCurrentScope();
        $scope->createReference($toVariableName, $fromVariableName);

        return array();
    }
872138
public function getPropertiesArray(NodeInterface $node)
    {
        $properties = [];
        foreach ($node->getNodeType()->getProperties() as $propertyName => $propertyConfiguration) {
            if ($propertyName[0] === '_' && $propertyName[1] === '_') {
                // skip fully-private properties
                continue;
            }

            $properties[$propertyName] = $this->getProperty($node, $propertyName);
        }

        return $properties;
    }
824947
public function getProperties(Crawler $node = null)
    {
        $node = $node ?: $this->node;

        $properties = [
            'titre'      => (new DefaultSanitizer)->clean(
                $node->filter('h1')->text()
            ),
            'created_at' => $node
                ->filter('*[itemprop=availabilityStarts]')
                ->first()
                ->attr('content'),
            'is_pro'     => ($node->filter('.ispro')->count()),
        ];

        $node->filter('h2')
            ->each(function (Crawler $crawler) use (&$properties) {
                $properties = array_merge(
                    $properties,
                    $this->sanitize(
                        $crawler->filter('.property')->text(),
                        $crawler->filter('.value')->text()
                    )
                );
            });

        return ['properties' => $properties];
    }
1241166
public function loadNode($node)
    {
        //If the node isn't already loaded
        if(!isset($this->nodeProxyCache[$node->getId()]))
        {
            //Get the nodes class name (from label)
            $labels = $this->client->getLabels($node);
            $class = $labels[0]->getName();

            //Create a proxy entity
            $entity = $this->proxyFactory->fromNode($node, $this->metaRepository, $class);

            $this->nodeProxyCache[$node->getId()] = $entity;
            $this->everymanNodeCache[$this->getHash($entity)] = $node;
        }

        return $this->nodeProxyCache[$node->getId()];
    }
28153
private function hydrateReferenceField(
        NodeInterface $node,
        $document,
        DocumentAccessor $accessor,
        $fieldName,
        $locale,
        array $fieldMapping,
        array $options
    ) {
        try {
            $phpcrName = $this->encoder->encode($fieldMapping['encoding'], $fieldMapping['property'], $locale);
            $referencedNode = $node->getPropertyValueWithDefault(
                $phpcrName,
                $this->getDefaultValue($fieldMapping)
            );

            if ($referencedNode) {
                $accessor->set(
                    $fieldName,
                    $this->proxyFactory->createProxyForNode($document, $referencedNode, $options)
                );
            }
        } catch (InvalidLocaleException $ex) {
            // arguments invalid, no valid propertyname could be generated (e.g. no locale given for localized encoding)
            return;
        }
    }
1254966
public function createRoot(Node $node)
    {
        if($node instanceof NodeWrapper)
        {
            throw new \InvalidArgumentException('Can\'t create a root node from a NodeWrapper node');
        }

        $node->setLeftValue(1);
        $node->setRightValue(2);

        if($this->getConfiguration()->hasManyRoots())
        {
            $rootValue = $node->getId();
            if($rootValue === null)
            {
                // Set a temporary value in case wrapped node requires root value to be set
                $node->setRootValue(0);
                $this->getEntityManager()->persist($node);
                $this->getEntityManager()->flush();
                $rootValue = $node->getId();
            }

            if($rootValue === null)
            {
                // @codeCoverageIgnoreStart
                throw new \RuntimeException('Node must have an identifier available via getId()');
                // @codeCoverageIgnoreEnd
            }

            $node->setRootValue($rootValue);
        }


        $this->getEntityManager()->persist($node);
        $this->getEntityManager()->flush();

        return $this->wrapNode($node);
    }
1344824
public function getDocumentationFromNode($node)
    {
        // Any NamespaceDefinition comments likely apply to the file, not the declaration itself.
        if ($node instanceof Node\Statement\NamespaceDefinition) {
            return null;
        }

        // For properties and constants, set the node to the declaration node, rather than the individual property.
        // This is because they get defined as part of a list.
        $constOrPropertyDeclaration = ParserHelpers\tryGetPropertyDeclaration($node) ?? ParserHelpers\tryGetConstOrClassConstDeclaration($node);
        if ($constOrPropertyDeclaration !== null) {
            $node = $constOrPropertyDeclaration;
        }

        // For parameters, parse the function-like declaration to get documentation for a parameter
        if ($node instanceof Node\Parameter) {
            $variableName = $node->getName();

            $functionLikeDeclaration = ParserHelpers\getFunctionLikeDeclarationFromParameter($node);
            $docBlock = $this->getDocBlock($functionLikeDeclaration);

            $parameterDocBlockTag = $this->tryGetDocBlockTagForParameter($docBlock, $variableName);
            return $parameterDocBlockTag !== null ? $parameterDocBlockTag->getDescription()->render() : null;
        }

        // For everything else, get the doc block summary corresponding to the current node.
        $docBlock = $this->getDocBlock($node);
        if ($docBlock !== null) {
            // check whether we have a description, when true, add a new paragraph
            // with the description
            $description = $docBlock->getDescription()->render();

            if (empty($description)) {
                return $docBlock->getSummary();
            }

            return $docBlock->getSummary() . "\n\n" . $description;
        }
        return null;
    }
1159030
public function mutate(Node $node)
    {
        $node->value = new Node\Expr\BinaryOp\Greater($node->key, $node->value, $node->getAttributes());
        $node->key = null;

        return $node;
    }
458648
public static function getProtectedProperty($object, $property)
    {
        $refObject = new \ReflectionObject($object);
        $refProp   = $refObject->getProperty($property);
        $refProp->setAccessible(true);

        return $refProp->getValue($object);
    }
10706
public function permCacheKey(DataObject $node)
    {
        if ($node && $node->ID) {
            return self::ITEM_PREFIX . $this->idStr($node);
        }
    }
333145
protected function htmlFromNode($node)
    {
        $domDocument = new \DOMDocument();
        $newNode = $domDocument->importNode($node, true);
        $domDocument->appendChild($newNode);

        return $domDocument->saveHTML();
    }