1 | <?php |
||
25 | class Reader |
||
26 | { |
||
27 | /** |
||
28 | * File extensions list |
||
29 | */ |
||
30 | private const FILE_EXTENSIONS = [ |
||
31 | '', |
||
32 | '.pp', |
||
33 | '.pp2', |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * @var LexerInterface |
||
38 | */ |
||
39 | private $lexer; |
||
40 | |||
41 | /** |
||
42 | * Reader constructor. |
||
43 | */ |
||
44 | public function __construct() |
||
48 | |||
49 | /** |
||
50 | * @param Readable $input |
||
51 | * @return ParsingResult |
||
52 | * @throws \Railt\Io\Exception\NotReadableException |
||
53 | * @throws \Railt\Io\Exception\ExternalFileException |
||
54 | */ |
||
55 | public function read(Readable $input): ParsingResult |
||
66 | |||
67 | /** |
||
68 | * @param Readable $input |
||
69 | * @return \Traversable |
||
70 | * @throws \Railt\Io\Exception\NotReadableException |
||
71 | * @throws \Railt\Io\Exception\ExternalFileException |
||
72 | */ |
||
73 | private function lex(Readable $input): \Traversable |
||
95 | |||
96 | /** |
||
97 | * @param Readable $from |
||
98 | * @param TokenInterface $token |
||
99 | * @return Readable |
||
100 | * @throws \Railt\Io\Exception\NotReadableException |
||
101 | * @throws \Railt\Io\Exception\ExternalFileException |
||
102 | */ |
||
103 | private function include(Readable $from, TokenInterface $token): Readable |
||
118 | } |
||
119 |
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: