Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 23, 2023
1 parent 861c1b6 commit 9d01ba2
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/Snapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
use function array_keys;
use function array_merge;
use function array_reverse;
use function assert;
use function func_get_args;
use function get_declared_classes;
use function get_declared_interfaces;
use function get_declared_traits;
Expand Down Expand Up @@ -309,16 +307,8 @@ private function canBeSerialized(mixed $variable): bool
return true;
}

private function enumerateObjectsAndResources(mixed $variable): array
private function enumerateObjectsAndResources(mixed $variable, Context $processed = new Context): array
{
if (isset(func_get_args()[1])) {
$processed = func_get_args()[1];
} else {
$processed = new Context;
}

assert($processed instanceof Context);

$result = [];

if ($processed->contains($variable)) {
Expand Down

0 comments on commit 9d01ba2

Please sign in to comment.