BetterReflection\Reflection\ReflectionParameter::parseDefaultValueNode PHP Метод

parseDefaultValueNode() приватный Метод

private parseDefaultValueNode ( )
    private function parseDefaultValueNode()
    {
        if (!$this->isDefaultValueAvailable()) {
            throw new \LogicException('This parameter does not have a default value available');
        }
        $defaultValueNode = $this->node->default;
        if ($defaultValueNode instanceof Node\Expr\ClassConstFetch) {
            $this->isDefaultValueConstant = true;
            $this->defaultValueConstantName = $defaultValueNode->name;
            $this->defaultValueConstantType = self::CONST_TYPE_CLASS;
        }
        if ($defaultValueNode instanceof Node\Expr\ConstFetch && !in_array($defaultValueNode->name->parts[0], ['true', 'false', 'null'])) {
            $this->isDefaultValueConstant = true;
            $this->defaultValueConstantName = $defaultValueNode->name->parts[0];
            $this->defaultValueConstantType = self::CONST_TYPE_DEFINED;
            $this->defaultValue = null;
            return;
        }
        $this->defaultValue = (new CompileNodeToValue())->__invoke($defaultValueNode, new CompilerContext($this->reflector, $this->getDeclaringClass()));
    }