1 | <?php |
||
32 | class Compiler |
||
33 | { |
||
34 | /** |
||
35 | * @var ReflectionInterface |
||
36 | */ |
||
37 | private $reflection; |
||
38 | |||
39 | /** |
||
40 | * @var Dictionary|CallbackDictionary |
||
41 | */ |
||
42 | private $dictionary; |
||
43 | |||
44 | /** |
||
45 | * @var Parser |
||
46 | */ |
||
47 | private $parser; |
||
48 | |||
49 | /** |
||
50 | * @var Environment |
||
51 | */ |
||
52 | private $env; |
||
53 | |||
54 | /** |
||
55 | * @var CallStack |
||
56 | */ |
||
57 | private $stack; |
||
58 | |||
59 | /** |
||
60 | * @var Pipeline |
||
61 | */ |
||
62 | private $pipeline; |
||
63 | |||
64 | /** |
||
65 | * Compiler constructor. |
||
66 | * @throws \Railt\Io\Exception\ExternalFileException |
||
67 | * @throws \Railt\Reflection\Exception\TypeConflictException |
||
68 | */ |
||
69 | public function __construct() |
||
79 | |||
80 | /** |
||
81 | * @param \Closure $then |
||
82 | */ |
||
83 | public function autoload(\Closure $then): void |
||
91 | |||
92 | /** |
||
93 | * @param Document $document |
||
94 | * @param Readable $file |
||
95 | * @return Compiler |
||
96 | */ |
||
97 | private function load(Document $document, Readable $file): self |
||
108 | |||
109 | /** |
||
110 | * @param Readable $file |
||
111 | * @return DocumentInterface |
||
112 | * @throws CompilerException |
||
113 | */ |
||
114 | public function compile(Readable $file): DocumentInterface |
||
126 | |||
127 | /** |
||
128 | * @param Document $document |
||
129 | * @param Readable $file |
||
130 | * @return RuleInterface |
||
131 | * @throws CompilerException |
||
132 | */ |
||
133 | private function parse(Document $document, Readable $file): RuleInterface |
||
145 | } |
||
146 |
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: