1 | <?php |
||
18 | class StringStream |
||
19 | { |
||
20 | /** |
||
21 | * StringStream constructor. |
||
22 | * @param string $string |
||
23 | */ |
||
24 | public function __construct(string $string) |
||
30 | |||
31 | /** |
||
32 | * Current char of stream |
||
33 | * @return string |
||
34 | */ |
||
35 | public function current() : string |
||
39 | |||
40 | /** |
||
41 | * @return int |
||
42 | */ |
||
43 | public function ord() : int |
||
47 | |||
48 | /** |
||
49 | * Current char of stream as AsciiChar |
||
50 | * @return AsciiChar |
||
51 | * @throws \LogicException |
||
52 | * @throws \InvalidArgumentException |
||
53 | */ |
||
54 | public function currentAscii() : AsciiChar |
||
58 | |||
59 | /** |
||
60 | * Position in stream of current char |
||
61 | * @return int |
||
62 | */ |
||
63 | public function position() : int |
||
67 | |||
68 | /** |
||
69 | * go to next char in stream |
||
70 | */ |
||
71 | public function next() |
||
76 | |||
77 | /** |
||
78 | * go to previous char of stream |
||
79 | */ |
||
80 | public function previous() |
||
85 | |||
86 | /** |
||
87 | * go to start of stream |
||
88 | */ |
||
89 | public function start() |
||
93 | |||
94 | /** |
||
95 | * is start of stream |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function isStart() : bool |
||
102 | |||
103 | /** |
||
104 | * go to end of stream |
||
105 | */ |
||
106 | public function end() |
||
110 | |||
111 | /** |
||
112 | * is end of stream |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function isEnd() : bool |
||
119 | |||
120 | /** |
||
121 | * ignore chars in stream while it is white space |
||
122 | * @throws \InvalidArgumentException |
||
123 | * @throws \LogicException |
||
124 | */ |
||
125 | public function ignoreWhitespace() |
||
133 | |||
134 | /** |
||
135 | * ignore chars in stream while it is horizontal space |
||
136 | * @throws \LogicException |
||
137 | * @throws \InvalidArgumentException |
||
138 | */ |
||
139 | public function ignoreHorizontalSpace() |
||
147 | |||
148 | /** |
||
149 | * ignore chars in stream while it is vertical space |
||
150 | * @throws \InvalidArgumentException |
||
151 | * @throws \LogicException |
||
152 | */ |
||
153 | public function ignoreVerticalSpace() |
||
161 | |||
162 | /** |
||
163 | * @param string $string |
||
164 | * @return ArrayIterator |
||
165 | */ |
||
166 | private function makeIterator(string $string) : ArrayIterator |
||
170 | |||
171 | /** |
||
172 | * @var array |
||
173 | */ |
||
174 | private $stream; |
||
175 | |||
176 | /** |
||
177 | * if next returns false it member will be true, else false |
||
178 | * @var bool |
||
179 | */ |
||
180 | private $pointerAtEnd; |
||
181 | |||
182 | /** |
||
183 | * if prev returns false it member will be true, else false |
||
184 | * @var bool |
||
185 | */ |
||
186 | private $pointerAtStart; |
||
187 | } |
||
188 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..