| 1 | <?php |
||
| 20 | class YamlHandler extends TypeHandler |
||
| 21 | { |
||
| 22 | protected $interpolator; |
||
| 23 | |||
| 24 | 2 | public function __construct(Interpolator $interpolator, $options = []) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritdoc} |
||
| 32 | */ |
||
| 33 | public function renderType($data) |
||
| 34 | { |
||
| 35 | /// XXX TODO fix getItems crutch |
||
| 36 | return Yaml::dump(ArrayHelper::toArray(method_exists($data, 'getItems') ? $data->getItems() : $data), 4); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | 2 | public function parse($yaml) |
|
| 49 | } |
||
| 50 |