File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -35,22 +35,24 @@ 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+
43+ if (isset ($ value ['$id ' ]) || isset ($ value ['$collection ' ])) {
4344 $ input [$ key ] = new self ($ value );
4445 continue ;
4546 }
47+
4648 foreach ($ value as $ childKey => $ child ) {
4749 if ((isset ($ child ['$id ' ]) || isset ($ child ['$collection ' ])) && (!$ child instanceof self)) {
4850 $ value [$ childKey ] = new self ($ child );
4951 }
5052 }
51- }
5253
53- unset($ value ); // Unset Reference
54+ $ input [$ key ] = $ value ;
55+ }
5456
5557 parent ::__construct ($ input );
5658 }
You can’t perform that action at this time.
0 commit comments