| 1 | <?php |
||
| 11 | abstract class AbstractTransformer implements TransformerInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Default transformer options |
||
| 15 | * |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $defaults = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | */ |
||
| 23 | public function setDefaults(array $defaults) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Parse and validates options |
||
| 30 | * |
||
| 31 | * @param string|array $options |
||
| 32 | * |
||
| 33 | * @return array |
||
| 34 | * @throws InvalidArgumentException |
||
| 35 | */ |
||
| 36 | protected function parseOptions($options) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Parse and validates options from string |
||
| 58 | * |
||
| 59 | * @param $options |
||
| 60 | * |
||
| 61 | * @return array |
||
| 62 | */ |
||
| 63 | abstract protected function parseOptionsString($options); |
||
| 64 | } |
||
| 65 |