Skip to content

Commit

Permalink
6043102872: PHP8.1 update
Browse files Browse the repository at this point in the history
  • Loading branch information
xkoevoet committed Jun 8, 2023
1 parent 7189f5b commit 7413078
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"symfony/console": "^2.7"
},
"require": {
"php": ">=5.6.0"
"php": ">=8.1"
},
"autoload": {
"files": [
Expand Down
21 changes: 19 additions & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use IteratorAggregate;
use Traversable;

class Collection implements IteratorAggregate, \Serializable, CollectionInterface
class Collection implements IteratorAggregate, CollectionInterface
{
use CollectionTrait;

Expand Down Expand Up @@ -95,7 +95,7 @@ public static function range($start = 0, $end = null, $step = 1)
* {@inheritdoc}
* @throws InvalidReturnValue
*/
public function getIterator()
public function getIterator(): Traversable
{
if ($this->inputFactory) {
$input = call_user_func($this->inputFactory);
Expand Down Expand Up @@ -131,11 +131,28 @@ function ($value, $key) {
);
}

public function __serialize()
{
return toArray(
map(
$this->input,
function ($value, $key) {
return [$key, $value];
}
)
);
}

/**
* {@inheritdoc}
*/
public function unserialize($serialized)
{
$this->input = dereferenceKeyValue(unserialize($serialized));
}

public function __unserialize($data)
{
$this->input = dereferenceKeyValue($data);
}
}

0 comments on commit 7413078

Please sign in to comment.