| 1 | <?php |
||
| 8 | class YamlSerializer extends Object implements IRestSerializer { |
||
|
|
|||
| 9 | |||
| 10 | /** |
||
| 11 | * @config |
||
| 12 | */ |
||
| 13 | private static $is_active = true; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * The content type. |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $contentType = "application/yaml"; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Serializes the given data into a yaml string. |
||
| 23 | * |
||
| 24 | * @param array $data the data that should be serialized |
||
| 25 | * @return string a yaml formatted string |
||
| 26 | */ |
||
| 27 | public function serialize($data) { |
||
| 31 | |||
| 32 | public function contentType() { |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Indicates if the serializer is active. |
||
| 38 | * Serializers can be deactivated to use another implementation for the same mime type. |
||
| 39 | * |
||
| 40 | * @return boolean |
||
| 41 | */ |
||
| 42 | public function active() { |
||
| 45 | } |
||
| 46 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.