Skip to content

Commit 5b8a57d

Browse files
committed
Revert for a second PR
1 parent b9ee1a7 commit 5b8a57d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Database/Document.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public function __construct(array $input = [])
3535
throw new StructureException('$permissions must be of type array');
3636
}
3737

38-
foreach ($input as $key => $value) {
38+
foreach ($input as $key => &$value) {
3939
if (!\is_array($value)) {
4040
continue;
4141
}
42-
if (isset($value['$id']) || isset($value['$collection'])) {
42+
if ((isset($value['$id']) || isset($value['$collection']))) {
4343
$input[$key] = new self($value);
4444
continue;
4545
}
@@ -48,10 +48,10 @@ public function __construct(array $input = [])
4848
$value[$childKey] = new self($child);
4949
}
5050
}
51-
52-
$input[$key] = $value;
5351
}
5452

53+
unset($value); // Unset Reference
54+
5555
parent::__construct($input);
5656
}
5757

0 commit comments

Comments
 (0)