From 023669369ec31b7c8aece0b8e135a4e376c0d1ad Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Tue, 15 Jul 2025 12:32:20 +0200 Subject: [PATCH 1/2] fix b7c breaks --- src/DataObject.php | 6 +++--- src/DataSet.php | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/DataObject.php b/src/DataObject.php index 943ea65f..a8336621 100644 --- a/src/DataObject.php +++ b/src/DataObject.php @@ -199,7 +199,7 @@ public function dump($depth = 3, ?\SplObjectStorage $dumped = null) * @see IteratorAggregate::getIterator() * @since 1.0 */ - public function getIterator(): \ArrayIterator + public function getIterator() { $value = ArrayHelper::fromObject($this->dump(0)); @@ -213,7 +213,7 @@ public function getIterator(): \ArrayIterator * * @since 1.0 */ - public function jsonSerialize(): \stdClass + public function jsonSerialize() { return $this->dump(); } @@ -307,7 +307,7 @@ protected function setProperty($property, $value) * * @since 1.0 */ - public function count(): int + public function count() { return \count($this->properties); } diff --git a/src/DataSet.php b/src/DataSet.php index 2fb73eb9..799f7d08 100644 --- a/src/DataSet.php +++ b/src/DataSet.php @@ -62,7 +62,7 @@ public function __construct(array $objects = []) * * @since 1.0 */ - public function __call($method, $arguments = []): array + public function __call($method, $arguments = []) { $return = []; @@ -97,7 +97,7 @@ public function __call($method, $arguments = []): array * * @since 1.0 */ - public function __get($property): array + public function __get($property) { $return = []; @@ -121,7 +121,7 @@ public function __get($property): array * * @since 1.0 */ - public function __isset($property): bool + public function __isset($property) { $return = []; @@ -149,7 +149,7 @@ public function __isset($property): bool * * @since 1.0 */ - public function __set($property, $value): void + public function __set($property, $value) { // Iterate through the objects. foreach ($this->objects as $object) { @@ -171,7 +171,7 @@ public function __set($property, $value): void * * @since 1.0 */ - public function __unset($property): void + public function __unset($property) { // Iterate through the objects. foreach ($this->objects as $object) { @@ -189,7 +189,7 @@ public function __unset($property): void * @since 1.2.0 * @throws \InvalidArgumentException */ - public function getObjectsKeys($type = 'all'): array + public function getObjectsKeys($type = 'all') { $keys = null; @@ -220,7 +220,7 @@ public function getObjectsKeys($type = 'all'): array * * @since 1.2.0 */ - public function toArray($associative = true, ...$keys): array + public function toArray($associative = true, ...$keys) { if (empty($keys)) { $keys = $this->getObjectsKeys(); @@ -255,7 +255,7 @@ public function toArray($associative = true, ...$keys): array * * @since 1.0 */ - public function count(): int + public function count() { return \count($this->objects); } @@ -267,7 +267,7 @@ public function count(): int * * @since 1.0 */ - public function clear(): DataSet + public function clear() { $this->objects = []; $this->rewind(); @@ -282,7 +282,7 @@ public function clear(): DataSet * * @since 1.0 */ - public function current(): DataObject|bool + public function current() { return is_scalar($this->current) ? $this->objects[$this->current] : false; } @@ -300,7 +300,7 @@ public function current(): DataObject|bool * @see DataObject::dump() * @since 1.0 */ - public function dump($depth = 3, ?\SplObjectStorage $dumped = null): array + public function dump($depth = 3, ?\SplObjectStorage $dumped = null) { // Check if we should initialise the recursion tracker. if ($dumped === null) { @@ -333,7 +333,7 @@ public function dump($depth = 3, ?\SplObjectStorage $dumped = null): array * * @since 1.0 */ - public function jsonSerialize(): array + public function jsonSerialize() { $return = []; From e55a7c8438db2fb9039d34b54e2a051f0d8a88ee Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Tue, 15 Jul 2025 12:39:46 +0200 Subject: [PATCH 2/2] phpstan fix kind of --- src/DataObject.php | 3 +++ src/DataSet.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/DataObject.php b/src/DataObject.php index a8336621..dbb1928b 100644 --- a/src/DataObject.php +++ b/src/DataObject.php @@ -199,6 +199,7 @@ public function dump($depth = 3, ?\SplObjectStorage $dumped = null) * @see IteratorAggregate::getIterator() * @since 1.0 */ + #[\ReturnTypeWillChange] public function getIterator() { $value = ArrayHelper::fromObject($this->dump(0)); @@ -213,6 +214,7 @@ public function getIterator() * * @since 1.0 */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->dump(); @@ -307,6 +309,7 @@ protected function setProperty($property, $value) * * @since 1.0 */ + #[\ReturnTypeWillChange] public function count() { return \count($this->properties); diff --git a/src/DataSet.php b/src/DataSet.php index 799f7d08..f5ff2351 100644 --- a/src/DataSet.php +++ b/src/DataSet.php @@ -255,6 +255,7 @@ public function toArray($associative = true, ...$keys) * * @since 1.0 */ + #[\ReturnTypeWillChange] public function count() { return \count($this->objects); @@ -282,6 +283,7 @@ public function clear() * * @since 1.0 */ + #[\ReturnTypeWillChange] public function current() { return is_scalar($this->current) ? $this->objects[$this->current] : false;