1 | <?php |
||
27 | class Reader |
||
28 | { |
||
29 | /** |
||
30 | * @var Readable |
||
31 | */ |
||
32 | private $file; |
||
33 | |||
34 | /** |
||
35 | * @var ParserInterface |
||
36 | */ |
||
37 | private $pp; |
||
38 | |||
39 | /** |
||
40 | * @var LexerInterface |
||
41 | */ |
||
42 | private $lexer; |
||
43 | |||
44 | /** |
||
45 | * @var GrammarInterface |
||
46 | */ |
||
47 | private $grammar; |
||
48 | |||
49 | /** |
||
50 | * @var Analyzer |
||
51 | */ |
||
52 | private $analyzer; |
||
53 | |||
54 | /** |
||
55 | * Reader constructor. |
||
56 | * @param Readable $file |
||
57 | */ |
||
58 | public function __construct(Readable $file) |
||
68 | |||
69 | /** |
||
70 | * @return void |
||
71 | */ |
||
72 | private function boot(): void |
||
80 | |||
81 | /** |
||
82 | * @return ParserInterface |
||
83 | * @throws \Railt\Io\Exception\ExternalFileException |
||
84 | * @throws \Railt\Io\Exception\NotReadableException |
||
85 | */ |
||
86 | public function getParser(): ParserInterface |
||
96 | |||
97 | /** |
||
98 | * @param Readable $file |
||
99 | * @throws \Railt\Io\Exception\ExternalFileException |
||
100 | * @throws \Railt\Io\Exception\NotReadableException |
||
101 | */ |
||
102 | private function addGrammar(Readable $file): void |
||
128 | } |
||
129 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: