public function getAnnotationFromMap(string $annotationType): Annotation
    {
        // Get the annotations map (annotation name to annotation class)
        $annotationsMap = $this->getAnnotationsMap();

        // If an annotation is mapped to a class
        if ($annotationType && array_key_exists(
                $annotationType,
                $annotationsMap
            )
        ) {
            // Set a new class based on the match found
            $annotation = new $annotationsMap[$annotationType]();
        } else {
            // Otherwise set a new base annotation model
            $annotation = new Annotation();
        }

        return $annotation;
    }
public function getAnnotationFromMap(string $annotationType): Annotation
    {
        // Get the annotations map (annotation name to annotation class)
        $annotationsMap = $this->getAnnotationsMap();

        // If an annotation is mapped to a class
        if ($annotationType && array_key_exists(
                $annotationType,
                $annotationsMap
            )
        ) {
            // Set a new class based on the match found
            $annotation = new $annotationsMap[$annotationType]();
        } else {
            // Otherwise set a new base annotation model
            $annotation = new Annotation();
        }

        return $annotation;
    }
public function getAnnotationFromMap ( string $ annotationType ) : Annotation { // Get the annotations map (annotation name to annotation class) $ annotationsMap = $ this -> getAnnotationsMap ( ) ; // If an annotation is mapped to a class if ( $ annotationType && array_key_exists ( $ annotationType , $ annotationsMap ) ) { // Set a new class based on the match found $ annotation = new $ annotationsMap [ $ annotationType ] ( ) ; } else { // Otherwise set a new base annotation model $ annotation = new Annotation ( ) ; } return $ annotation ; }
Get an annotation model from the annotations map.

@param string $annotationType The annotation type

@return \Valkyrja\Annotations\Annotation
Get an annotation model from the annotations map .