PHPStan\Analyser\Scope::getFile PHP Method

getFile() public method

public getFile ( ) : string
return string
    public function getFile() : string
    {
        return $this->file;
    }

Usage Example

Example #1
0
 private function enterClassMethod(Scope $scope, Node\Stmt\ClassMethod $classMethod) : Scope
 {
     $fileTypeMap = $this->fileTypeMapper->getTypeMap($scope->getFile());
     $phpDocParameterTypes = [];
     $phpDocReturnType = null;
     if ($classMethod->getDocComment() !== null) {
         $docComment = $classMethod->getDocComment()->getText();
         $phpDocParameterTypes = TypehintHelper::getPhpDocParameterTypesFromMethod($fileTypeMap, array_map(function (Param $parameter) : string {
             return $parameter->name;
         }, $classMethod->params), $docComment);
         $phpDocReturnType = TypehintHelper::getPhpDocReturnTypeFromMethod($fileTypeMap, $docComment);
     }
     return $scope->enterClassMethod($classMethod, $phpDocParameterTypes, $phpDocReturnType);
 }