| 1 | <?php |
||
| 9 | abstract class RecursiveTransform extends Transform |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Define a list of array keys `transformValue` should apply to. |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $keys = []; |
||
| 16 | |||
| 17 | public function getKeys() |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Apply the `transformValue` function to all leafs at the defined keys. |
||
| 24 | * @param array $config |
||
| 25 | * @return array transformed config |
||
| 26 | */ |
||
| 27 | public function transform($config) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Impelment this in all discrete classes |
||
| 40 | * @param mixed $value input |
||
| 41 | * @return mixed output value |
||
| 42 | */ |
||
| 43 | abstract public function transformValue($value); |
||
| 44 | } |
||
| 45 |