| 1 | <?php |
||
| 7 | * @author Christian Blank <[email protected]> |
||
| 8 | */ |
||
| 9 | class XmlSerializer extends \Object implements IRestSerializer { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @config |
||
| 13 | */ |
||
| 14 | private static $is_active = true; |
||
|
|
|||
| 15 | |||
| 16 | /** |
||
| 17 | * The content type. |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $contentType = "application/xml"; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Serializes the given data into a xml string. |
||
| 24 | * |
||
| 25 | * @param array $data the data that should be serialized |
||
| 26 | * @return string a xml formatted string |
||
| 27 | */ |
||
| 28 | public function serialize($data) { |
||
| 33 | |||
| 34 | public function contentType() { |
||
| 37 | |||
| 38 | private function toXml(\SimpleXMLElement $object, array $data) { |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Indicates if the serializer is active. |
||
| 54 | * Serializers can be deactivated to use another implementation for the same mime type. |
||
| 55 | * |
||
| 56 | * @return boolean |
||
| 57 | */ |
||
| 58 | public function active() { |
||
| 59 | return $this->config()->get('is_active'); |
||
| 60 | } |
||
| 62 |
This check marks private properties in classes that are never used. Those properties can be removed.