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.
Loading history...
27
*/
28
public function serialize($data) {
29
$xml = new \SimpleXMLElement('<result/>');
30
$this->toXml($xml, $data);
31
return $xml->asXML();
32
}
33
34
public function contentType() {
35
return $this->contentType;
36
}
37
38
private function toXml(\SimpleXMLElement $object, array $data) {
39
foreach( $data as $key => $value ) {
40
if(is_array($value) ) {
41
if( is_numeric($key) ){
42
$key = 'item'.$key; //dealing with <0/>..<n/> issues
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.