PHPStan\Reflection\FunctionReflectionFactory::create PHP 메소드

create() 공개 메소드

public create ( ReflectionFunction $reflection ) : FunctionReflection
$reflection ReflectionFunction
리턴 FunctionReflection
    public function create(\ReflectionFunction $reflection) : FunctionReflection;

Usage Example

예제 #1
0
파일: Broker.php 프로젝트: phpstan/phpstan
 public function getFunction(\PhpParser\Node\Name $nameNode, Scope $scope = null) : \PHPStan\Reflection\FunctionReflection
 {
     $functionName = $this->resolveFunctionName($nameNode, $scope);
     if ($functionName === null) {
         throw new \PHPStan\Broker\FunctionNotFoundException((string) $nameNode);
     }
     $lowerCasedFunctionName = strtolower($functionName);
     if (!isset($this->functionReflections[$lowerCasedFunctionName])) {
         $this->functionReflections[$lowerCasedFunctionName] = $this->functionReflectionFactory->create(new \ReflectionFunction($lowerCasedFunctionName));
     }
     return $this->functionReflections[$lowerCasedFunctionName];
 }
FunctionReflectionFactory