src/Serializer.php
private function doDeserializeProperty(Annotations\AbstractAnnotation $annotation, $property, $value)
    {
        // property is primitive type
        if (array_key_exists($property, $annotation::$_types)) {
            return $this->doDeserializeBaseProperty($annotation::$_types[$property], $value);
        }
        // property is embedded annotation
        foreach ($annotation::$_nested as $class => $declaration) {
            // property is an annotation
            if (is_string($declaration) && $declaration === $property) {
                return $this->doDeserialize($value, $class);
            }

            // property is an annotation array
            if (is_array($declaration) && count($declaration) === 1 && $declaration[0] === $property) {
                $annotationArr = [];
                foreach ($value as $v) {
                    $annotationArr[] = $this->doDeserialize($v, $class);
                }
                return $annotationArr;
            }

            // property is an annotation hash map
            if (is_array($declaration) && count($declaration) === 2 && $declaration[0] === $property) {
                $key = $declaration[1];
                $annotationHash = [];
                foreach ($value as $k => $v) {
                    $annotation = $this->doDeserialize($v, $class);
                    $annotation->$key = $k;
                    $annotationHash[$k] = $annotation;
                }
                return $annotationHash;
            }
        }

        return $value;
    }
private function doDeserializeProperty(Annotations\AbstractAnnotation $annotation, $property, $value)
    {
        // property is primitive type
        if (array_key_exists($property, $annotation::$_types)) {
            return $this->doDeserializeBaseProperty($annotation::$_types[$property], $value);
        }
        // property is embedded annotation
        foreach ($annotation::$_nested as $class => $declaration) {
            // property is an annotation
            if (is_string($declaration) && $declaration === $property) {
                return $this->doDeserialize($value, $class);
            }

            // property is an annotation array
            if (is_array($declaration) && count($declaration) === 1 && $declaration[0] === $property) {
                $annotationArr = [];
                foreach ($value as $v) {
                    $annotationArr[] = $this->doDeserialize($v, $class);
                }
                return $annotationArr;
            }

            // property is an annotation hash map
            if (is_array($declaration) && count($declaration) === 2 && $declaration[0] === $property) {
                $key = $declaration[1];
                $annotationHash = [];
                foreach ($value as $k => $v) {
                    $annotation = $this->doDeserialize($v, $class);
                    $annotation->$key = $k;
                    $annotationHash[$k] = $annotation;
                }
                return $annotationHash;
            }
        }

        return $value;
    }
private function doDeserializeProperty ( Annotations \ AbstractAnnotation $ annotation , $ property , $ value ) { // property is primitive type if ( array_key_exists ( $ property , $ annotation :: $ _types ) ) { return $ this -> doDeserializeBaseProperty ( $ annotation :: $ _types [ $ property ] , $ value ) ; } // property is embedded annotation foreach ( $ annotation :: $ _nested as $ class => $ declaration ) { // property is an annotation if ( is_string ( $ declaration ) && $ declaration === $ property ) { return $ this -> doDeserialize ( $ value , $ class ) ; } // property is an annotation array if ( is_array ( $ declaration ) && count ( $ declaration ) === 1 && $ declaration [ 0 ] === $ property ) { $ annotationArr = [ ] ; foreach ( $ value as $ v ) { $ annotationArr [ ] = $ this -> doDeserialize ( $ v , $ class ) ; } return $ annotationArr ; } // property is an annotation hash map if ( is_array ( $ declaration ) && count ( $ declaration ) === 2 && $ declaration [ 0 ] === $ property ) { $ key = $ declaration [ 1 ] ; $ annotationHash = [ ] ; foreach ( $ value as $ k => $ v ) { $ annotation = $ this -> doDeserialize ( $ v , $ class ) ; $ annotation -> $ key = $ k ; $ annotationHash [ $ k ] = $ annotation ; } return $ annotationHash ; } } return $ value ; }
Deserialize the annotation's property.

@param Annotations\AbstractAnnotation $annotation
@param string                         $property
@param mixed                          $value

@return mixed
Deserialize the annotation s property .