Skip to content

Commit 48bd022

Browse files
committed
Merge branch '3.x-dev' into 4.x-dev
2 parents e1d4936 + 0f7829c commit 48bd022

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

src/DataObject.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ public function dump($depth = 3, ?\SplObjectStorage $dumped = null)
199199
* @see IteratorAggregate::getIterator()
200200
* @since 1.0
201201
*/
202-
public function getIterator(): \ArrayIterator
202+
#[\ReturnTypeWillChange]
203+
public function getIterator()
203204
{
204205
$value = ArrayHelper::fromObject($this->dump(0));
205206

@@ -209,11 +210,12 @@ public function getIterator(): \ArrayIterator
209210
/**
210211
* Gets the data properties in a form that can be serialised to JSON format.
211212
*
212-
* @return \stdClass
213+
* @return mixed
213214
*
214215
* @since 1.0
215216
*/
216-
public function jsonSerialize(): \stdClass
217+
#[\ReturnTypeWillChange]
218+
public function jsonSerialize()
217219
{
218220
return $this->dump();
219221
}
@@ -307,7 +309,8 @@ protected function setProperty($property, $value)
307309
*
308310
* @since 1.0
309311
*/
310-
public function count(): int
312+
#[\ReturnTypeWillChange]
313+
public function count()
311314
{
312315
return \count($this->properties);
313316
}

src/DataSet.php

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ public function toArray($associative = true, ...$keys): array
255255
*
256256
* @since 1.0
257257
*/
258-
public function count(): int
258+
#[\ReturnTypeWillChange]
259+
public function count()
259260
{
260261
return \count($this->objects);
261262
}
@@ -267,7 +268,7 @@ public function count(): int
267268
*
268269
* @since 1.0
269270
*/
270-
public function clear(): DataSet
271+
public function clear()
271272
{
272273
$this->objects = [];
273274
$this->rewind();
@@ -278,11 +279,12 @@ public function clear(): DataSet
278279
/**
279280
* Get the current data object in the set.
280281
*
281-
* @return DataObject|bool The current object, or false if the array is empty or the pointer is beyond the end of the elements.
282+
* @return DataObject|false The current object, or false if the array is empty or the pointer is beyond the end of the elements.
282283
*
283284
* @since 1.0
284285
*/
285-
public function current(): DataObject|bool
286+
#[\ReturnTypeWillChange]
287+
public function current()
286288
{
287289
return is_scalar($this->current) ? $this->objects[$this->current] : false;
288290
}
@@ -349,11 +351,12 @@ public function jsonSerialize(): array
349351
/**
350352
* Gets the key of the current object in the iterator.
351353
*
352-
* @return int|bool|null The object key on success; false on failure.
354+
* @return integer|false The object key on success; false on failure.
353355
*
354356
* @since 1.0
355357
*/
356-
public function key(): int|bool|null
358+
#[\ReturnTypeWillChange]
359+
public function key()
357360
{
358361
return $this->current;
359362
}
@@ -396,7 +399,8 @@ public function walk(callable $funcname): bool
396399
*
397400
* @since 1.0
398401
*/
399-
public function next(): void
402+
#[\ReturnTypeWillChange]
403+
public function next()
400404
{
401405
// Get the object offsets.
402406
$keys = $this->keys();
@@ -429,7 +433,8 @@ public function next(): void
429433
*
430434
* @since 1.0
431435
*/
432-
public function offsetExists($offset): bool
436+
#[\ReturnTypeWillChange]
437+
public function offsetExists($offset)
433438
{
434439
return isset($this->objects[$offset]);
435440
}
@@ -443,7 +448,8 @@ public function offsetExists($offset): bool
443448
*
444449
* @since 1.0
445450
*/
446-
public function offsetGet($offset): DataObject|null
451+
#[\ReturnTypeWillChange]
452+
public function offsetGet($offset)
447453
{
448454
return $this->objects[$offset] ?? null;
449455
}
@@ -459,7 +465,8 @@ public function offsetGet($offset): DataObject|null
459465
* @since 1.0
460466
* @throws \InvalidArgumentException if an object is not an instance of DataObject.
461467
*/
462-
public function offsetSet($offset, $object): void
468+
#[\ReturnTypeWillChange]
469+
public function offsetSet($offset, $object)
463470
{
464471
if (!($object instanceof DataObject)) {
465472
throw new \InvalidArgumentException(
@@ -488,7 +495,8 @@ public function offsetSet($offset, $object): void
488495
*
489496
* @since 1.0
490497
*/
491-
public function offsetUnset($offset): void
498+
#[\ReturnTypeWillChange]
499+
public function offsetUnset($offset)
492500
{
493501
if (!isset($this[$offset])) {
494502
// Do nothing if the offset does not exist.
@@ -521,7 +529,8 @@ public function offsetUnset($offset): void
521529
*
522530
* @since 1.0
523531
*/
524-
public function rewind(): void
532+
#[\ReturnTypeWillChange]
533+
public function rewind()
525534
{
526535
// Set the current position to the first object.
527536
if (empty($this->objects)) {
@@ -539,7 +548,8 @@ public function rewind(): void
539548
*
540549
* @since 1.0
541550
*/
542-
public function valid(): bool
551+
#[\ReturnTypeWillChange]
552+
public function valid()
543553
{
544554
// Check the current position.
545555
if (!is_scalar($this->current) || !isset($this->objects[$this->current])) {

0 commit comments

Comments
 (0)