src/Box.php
source
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Serializor; |
| 6 | |
| 7 | /** |
| 8 | * This class is used to indicate that the unserialized data |
| 9 | * needs special treatment in order to correctly restore the |
| 10 | * state after unserialization. |
| 11 | * |
| 12 | * @package Serializor |
| 13 | */ |
| 14 | final class Box |
| 15 | { |
| 16 | public mixed $val; |
| 17 | public array $shortcuts; |
| 18 | |
| 19 | public function __construct(array $val, array $shortcuts = []) |
| 20 | { |
| 21 | $this->val = &$val[0]; |
| 22 | $this->shortcuts = $shortcuts; |
| 23 | } |
| 24 | } |
| 25 |