1 | <?php |
||
31 | class Compiler |
||
32 | { |
||
33 | /** |
||
34 | * @var ReflectionInterface |
||
35 | */ |
||
36 | private $reflection; |
||
37 | |||
38 | /** |
||
39 | * @var Dictionary|CallbackDictionary |
||
40 | */ |
||
41 | private $dictionary; |
||
42 | |||
43 | /** |
||
44 | * @var Parser |
||
45 | */ |
||
46 | private $parser; |
||
47 | |||
48 | /** |
||
49 | * Compiler constructor. |
||
50 | * @throws \Railt\Io\Exception\ExternalFileException |
||
51 | * @throws \Railt\Reflection\Exception\TypeConflictException |
||
52 | */ |
||
53 | 1 | public function __construct() |
|
59 | |||
60 | /** |
||
61 | * @param \Closure $then |
||
62 | */ |
||
63 | public function autoload(\Closure $then): void |
||
71 | |||
72 | /** |
||
73 | * @param Readable $file |
||
74 | * @return DocumentInterface |
||
75 | * @throws \Railt\Io\Exception\ExternalFileException |
||
76 | */ |
||
77 | 1 | public function compile(Readable $file): DocumentInterface |
|
86 | |||
87 | /** |
||
88 | * @param Readable $file |
||
89 | * @return RuleInterface |
||
90 | * @throws CompilerException |
||
91 | */ |
||
92 | 1 | private function parse(Readable $file): RuleInterface |
|
103 | } |
||
104 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: