1 | <?php |
||
30 | class Frontend implements LoggerAwareInterface |
||
31 | { |
||
32 | use LoggerAwareTrait; |
||
33 | |||
34 | /** |
||
35 | * @var Parser |
||
36 | */ |
||
37 | private $parser; |
||
38 | |||
39 | /** |
||
40 | * @var Analyzer |
||
41 | */ |
||
42 | private $analyzer; |
||
43 | |||
44 | /** |
||
45 | * Frontend constructor. |
||
46 | */ |
||
47 | public function __construct() |
||
52 | |||
53 | /** |
||
54 | * @param Readable $file |
||
55 | * @return iterable|OpcodeInterface[] |
||
56 | * @throws SyntaxException |
||
57 | */ |
||
58 | public function load(Readable $file): iterable |
||
67 | |||
68 | /** |
||
69 | * @param LoggerInterface $logger |
||
70 | * @return Frontend |
||
71 | */ |
||
72 | public function setLogger(LoggerInterface $logger): Frontend |
||
79 | |||
80 | /** |
||
81 | * @param Readable $file |
||
82 | * @param Context $context |
||
83 | * @return iterable|OpcodeInterface[] |
||
84 | * @throws SyntaxException |
||
85 | */ |
||
86 | private function collect(Readable $file, Context $context): iterable |
||
102 | |||
103 | /** |
||
104 | * @param NodeInterface $node |
||
105 | * @param Context $context |
||
106 | * @return iterable|Opcode[]|\Generator |
||
107 | */ |
||
108 | private function bypass(NodeInterface $node, Context $context): \Generator |
||
126 | |||
127 | /** |
||
128 | * @param ProvidesOpcode $provider |
||
129 | * @param Context $context |
||
130 | * @return \Generator|OpcodeInterface[] |
||
131 | */ |
||
132 | private function extract(ProvidesOpcode $provider, Context $context): \Generator |
||
143 | |||
144 | /** |
||
145 | * @param Readable $file |
||
146 | * @return RuleInterface |
||
147 | * @throws SyntaxException |
||
148 | */ |
||
149 | private function parse(Readable $file): RuleInterface |
||
160 | } |
||
161 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: