hiqdev /
hidev
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Automation tool mixed with code generator for easier continuous development |
||
| 4 | * |
||
| 5 | * @link https://github.com/hiqdev/hidev |
||
| 6 | * @package hidev |
||
| 7 | * @license BSD-3-Clause |
||
| 8 | * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/) |
||
| 9 | */ |
||
| 10 | |||
| 11 | namespace hidev\handlers; |
||
| 12 | |||
| 13 | use hiqdev\php\collection\ArrayHelper; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Handler for XML files. |
||
| 17 | */ |
||
| 18 | class XmlHandler extends TypeHandler |
||
| 19 | { |
||
| 20 | protected $_xml; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * {@inheritdoc} |
||
| 24 | */ |
||
| 25 | public function renderType($data) |
||
|
0 ignored issues
–
show
|
|||
| 26 | { |
||
| 27 | return $this->_xml->asXML(); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritdoc} |
||
| 32 | */ |
||
| 33 | public function parsePath($path, $minimal = null) |
||
| 34 | { |
||
| 35 | $this->_xml = simplexml_load_file(file_exists($path) ? $path : $minimal); |
||
| 36 | |||
| 37 | return ArrayHelper::toArray($this->_xml); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.