1 | <?php |
||
12 | class FileParser |
||
13 | { |
||
14 | /** |
||
15 | * @var \PhpParser\Parser |
||
16 | */ |
||
17 | protected $parser; |
||
18 | |||
19 | /** |
||
20 | * @var \PhpParser\NodeTraverser |
||
21 | */ |
||
22 | protected $nodeTraverser; |
||
23 | |||
24 | /** |
||
25 | * @var Compiler |
||
26 | */ |
||
27 | protected $compiler; |
||
28 | |||
29 | /** |
||
30 | * @var \PHPSA\Compiler\DefinitionVisitor |
||
31 | */ |
||
32 | protected $definitionVisitor; |
||
33 | |||
34 | /** |
||
35 | * @param \PhpParser\Parser $parser |
||
36 | * @param Compiler $compiler |
||
37 | */ |
||
38 | 1 | public function __construct(\PhpParser\Parser $parser, Compiler $compiler) |
|
49 | |||
50 | /** |
||
51 | * @param string $filepath |
||
52 | * @param Context $context |
||
53 | * @throws RuntimeException when filepath is not readable |
||
54 | */ |
||
55 | 1 | public function parserFile($filepath, Context $context) |
|
79 | } |
||
80 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.