Skip to content

Commit

Permalink
feat: Add support for var_export() to Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
dshafik committed Feb 4, 2025
1 parent d7f0f33 commit 73d9f7d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Bag/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,13 @@ public function unwrapped(): array

return OutputCollectionPipeline::process($output)->toArray();
}

/**
* @param array<mixed> $array
*/
public static function __set_state(array $array): object
{
// @phpstan-ignore-next-line new.static
return new static($array);
}
}

0 comments on commit 73d9f7d

Please sign in to comment.