getLocatedSource() публичный Метод

public getLocatedSource ( ) : BetterReflection\SourceLocator\Located\LocatedSource
Результат BetterReflection\SourceLocator\Located\LocatedSource
Пример #1
0
 /**
  * @param ParamNode $node
  * @param ReflectionFunctionAbstract $function
  * @param int $parameterIndex
  * @return ReflectionParameter
  */
 public static function createFromNode(ParamNode $node, ReflectionFunctionAbstract $function, $parameterIndex)
 {
     $param = new self();
     $param->name = $node->name;
     $param->function = $function;
     $param->isOptional = (bool) $node->isOptional;
     $param->hasDefaultValue = null !== $node->default;
     $param->isVariadic = (bool) $node->variadic;
     $param->isByReference = (bool) $node->byRef;
     $param->parameterIndex = (int) $parameterIndex;
     $param->typeHint = (new FindTypeFromAst())->__invoke($node->type, $function->getLocatedSource(), $function instanceof ReflectionMethod ? $function->getDeclaringClass()->getNamespaceName() : $function->getNamespaceName());
     if ($param->hasDefaultValue) {
         $param->parseDefaultValueNode($node->default);
     }
     $param->docBlockTypes = (new FindParameterType())->__invoke($function, $node);
     return $param;
 }
Пример #2
0
 /**
  * Get the type hint declared for the parameter. This is the real type hint
  * for the parameter, e.g. `method(closure $someFunc)` defined by the
  * method itself, and is separate from the docblock type hints.
  *
  * @see getDocBlockTypes()
  * @return Type
  */
 public function getTypeHint()
 {
     $namespaceForType = $this->function instanceof ReflectionMethod ? $this->function->getDeclaringClass()->getNamespaceName() : $this->function->getNamespaceName();
     return (new FindTypeFromAst())->__invoke($this->node->type, $this->function->getLocatedSource(), $namespaceForType);
 }