public function firstNamed(string $type): Annotation
    {
        if ($this->contain($type)) {
            return $this->types[$type][0];
        }

        throw new \ReflectionException('Can not find annotation ' . $type . ' for ' . $this->target);
    }
public function firstNamed(string $type): Annotation
    {
        if ($this->contain($type)) {
            return $this->types[$type][0];
        }

        throw new \ReflectionException('Can not find annotation ' . $type . ' for ' . $this->target);
    }
public function firstNamed ( string $ type ) : Annotation { if ( $ this -> contain ( $ type ) ) { return $ this -> types [ $ type ] [ 0 ] ; } throw new \ ReflectionException ( 'Can not find annotation ' . $ type . ' for ' . $ this -> target ) ; }
returns first annotation with given type name

If no such annotation exists a ReflectionException is thrown.

@param   string  $type
@return  \stubbles\reflect\annotation\Annotation
@throws  \ReflectionException
@since   5.3.0
returns first annotation with given type name