| 1 | <?php |
||
| 4 | class Hydrator |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * @var null |
||
| 8 | */ |
||
| 9 | protected $destination = null; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $source = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Hydrator constructor. |
||
| 18 | * @param $destination |
||
| 19 | * @internal param null $subject |
||
| 20 | */ |
||
| 21 | 10 | public function __construct($destination) |
|
| 25 | |||
| 26 | /** |
||
| 27 | * @param $destination |
||
| 28 | * @return Hydrator |
||
| 29 | */ |
||
| 30 | 8 | public static function hydrate($destination) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @param array $source |
||
| 37 | * @return null |
||
| 38 | * @throws \Exception |
||
| 39 | */ |
||
| 40 | 10 | public function with($source = []) |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @return null |
||
| 53 | * @throws \Exception |
||
| 54 | */ |
||
| 55 | 8 | private function run() |
|
| 83 | } |