1 | <?php |
||
9 | class XmlSerializer extends \SS_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() { |
||
61 | } |
||
62 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.