Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ public function dump($depth = 3, ?\SplObjectStorage $dumped = null)
* @see IteratorAggregate::getIterator()
* @since 1.0
*/
public function getIterator(): \ArrayIterator
#[\ReturnTypeWillChange]
public function getIterator()
{
$value = ArrayHelper::fromObject($this->dump(0));

Expand All @@ -213,7 +214,8 @@ public function getIterator(): \ArrayIterator
*
* @since 1.0
*/
public function jsonSerialize(): \stdClass
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->dump();
}
Expand Down Expand Up @@ -307,7 +309,8 @@ protected function setProperty($property, $value)
*
* @since 1.0
*/
public function count(): int
#[\ReturnTypeWillChange]
public function count()
{
return \count($this->properties);
}
Expand Down
26 changes: 14 additions & 12 deletions src/DataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(array $objects = [])
*
* @since 1.0
*/
public function __call($method, $arguments = []): array
public function __call($method, $arguments = [])
{
$return = [];

Expand Down Expand Up @@ -97,7 +97,7 @@ public function __call($method, $arguments = []): array
*
* @since 1.0
*/
public function __get($property): array
public function __get($property)
{
$return = [];

Expand All @@ -121,7 +121,7 @@ public function __get($property): array
*
* @since 1.0
*/
public function __isset($property): bool
public function __isset($property)
{
$return = [];

Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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;

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -255,7 +255,8 @@ public function toArray($associative = true, ...$keys): array
*
* @since 1.0
*/
public function count(): int
#[\ReturnTypeWillChange]
public function count()
{
return \count($this->objects);
}
Expand All @@ -267,7 +268,7 @@ public function count(): int
*
* @since 1.0
*/
public function clear(): DataSet
public function clear()
{
$this->objects = [];
$this->rewind();
Expand All @@ -282,7 +283,8 @@ public function clear(): DataSet
*
* @since 1.0
*/
public function current(): DataObject|bool
#[\ReturnTypeWillChange]
public function current()
{
return is_scalar($this->current) ? $this->objects[$this->current] : false;
}
Expand All @@ -300,7 +302,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) {
Expand Down Expand Up @@ -333,7 +335,7 @@ public function dump($depth = 3, ?\SplObjectStorage $dumped = null): array
*
* @since 1.0
*/
public function jsonSerialize(): array
public function jsonSerialize()
{
$return = [];

Expand Down