Skip to content

Commit 46b2a9d

Browse files
authored
Add ReturnTypeWillChange attributes (#26)
1 parent b5ba2e3 commit 46b2a9d

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

Result/AbstractResultsIterator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ protected function getManager()
165165
*
166166
* @return int
167167
*/
168+
#[\ReturnTypeWillChange]
168169
public function count()
169170
{
170171
return $this->count;
@@ -175,6 +176,7 @@ public function count()
175176
*
176177
* @return mixed
177178
*/
179+
#[\ReturnTypeWillChange]
178180
public function current()
179181
{
180182
return $this->getDocument($this->key());
@@ -183,6 +185,7 @@ public function current()
183185
/**
184186
* Move forward to next element.
185187
*/
188+
#[\ReturnTypeWillChange]
186189
public function next()
187190
{
188191
$this->advanceKey();
@@ -193,6 +196,7 @@ public function next()
193196
*
194197
* @return mixed
195198
*/
199+
#[\ReturnTypeWillChange]
196200
public function key()
197201
{
198202
return $this->key;
@@ -203,6 +207,7 @@ public function key()
203207
*
204208
* @return bool
205209
*/
210+
#[\ReturnTypeWillChange]
206211
public function valid()
207212
{
208213
if (!isset($this->documents)) {
@@ -222,6 +227,7 @@ public function valid()
222227
/**
223228
* Rewind the Iterator to the first element.
224229
*/
230+
#[\ReturnTypeWillChange]
225231
public function rewind()
226232
{
227233
$this->key = 0;

Result/Aggregation/AggregationValue.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public function find($path)
115115
/**
116116
* {@inheritdoc}
117117
*/
118+
#[\ReturnTypeWillChange]
118119
public function offsetExists($offset)
119120
{
120121
return array_key_exists($offset, $this->rawData);
@@ -123,6 +124,7 @@ public function offsetExists($offset)
123124
/**
124125
* {@inheritdoc}
125126
*/
127+
#[\ReturnTypeWillChange]
126128
public function offsetGet($offset)
127129
{
128130
if (!isset($this->rawData[$offset])) {
@@ -135,6 +137,7 @@ public function offsetGet($offset)
135137
/**
136138
* {@inheritdoc}
137139
*/
140+
#[\ReturnTypeWillChange]
138141
public function offsetSet($offset, $value)
139142
{
140143
throw new \LogicException('Aggregation result can not be changed on runtime.');
@@ -143,6 +146,7 @@ public function offsetSet($offset, $value)
143146
/**
144147
* {@inheritdoc}
145148
*/
149+
#[\ReturnTypeWillChange]
146150
public function offsetUnset($offset)
147151
{
148152
throw new \LogicException('Aggregation result can not be changed on runtime.');

Result/ArrayIterator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class ArrayIterator extends AbstractResultsIterator implements \ArrayAccess
1919
/**
2020
* {@inheritdoc}
2121
*/
22+
#[\ReturnTypeWillChange]
2223
public function offsetExists($offset)
2324
{
2425
return $this->documentExists($offset);
@@ -27,6 +28,7 @@ public function offsetExists($offset)
2728
/**
2829
* {@inheritdoc}
2930
*/
31+
#[\ReturnTypeWillChange]
3032
public function offsetGet($offset)
3133
{
3234
return $this->getDocument($offset);
@@ -35,6 +37,7 @@ public function offsetGet($offset)
3537
/**
3638
* {@inheritdoc}
3739
*/
40+
#[\ReturnTypeWillChange]
3841
public function offsetSet($offset, $value)
3942
{
4043
$this->documents[$offset] = $value;
@@ -43,6 +46,7 @@ public function offsetSet($offset, $value)
4346
/**
4447
* {@inheritdoc}
4548
*/
49+
#[\ReturnTypeWillChange]
4650
public function offsetUnset($offset)
4751
{
4852
unset($this->documents[$offset]);

Service/Json/JsonReader.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ protected function configureResolver(OptionsResolver $resolver)
190190
*
191191
* @return mixed
192192
*/
193+
#[\ReturnTypeWillChange]
193194
public function current()
194195
{
195196
if ($this->currentLine === null) {
@@ -202,6 +203,7 @@ public function current()
202203
/**
203204
* {@inheritdoc}
204205
*/
206+
#[\ReturnTypeWillChange]
205207
public function next()
206208
{
207209
$this->readLine();
@@ -212,6 +214,7 @@ public function next()
212214
/**
213215
* {@inheritdoc}
214216
*/
217+
#[\ReturnTypeWillChange]
215218
public function key()
216219
{
217220
return $this->key;
@@ -220,6 +223,7 @@ public function key()
220223
/**
221224
* {@inheritdoc}
222225
*/
226+
#[\ReturnTypeWillChange]
223227
public function valid()
224228
{
225229
return !feof($this->getFileHandler()) && $this->currentLine;
@@ -228,6 +232,7 @@ public function valid()
228232
/**
229233
* {@inheritdoc}
230234
*/
235+
#[\ReturnTypeWillChange]
231236
public function rewind()
232237
{
233238
rewind($this->getFileHandler());
@@ -239,6 +244,7 @@ public function rewind()
239244
/**
240245
* {@inheritdoc}
241246
*/
247+
#[\ReturnTypeWillChange]
242248
public function count()
243249
{
244250
$metadata = $this->getMetadata();

0 commit comments

Comments
 (0)