public function invoke(string $name, int $line): AnnotationInterface
    {
        $name = preg_replace('/@(?i)(PhpUnitGen|Pug)\\\\/', '', $name);
        switch (true) {
            case strcasecmp($name, 'get') === 0:
                $annotation = new GetAnnotation();
                break;
            case strcasecmp($name, 'set') === 0:
                $annotation = new SetAnnotation();
                break;
            case strcasecmp($name, 'construct') === 0:
                $annotation = new ConstructAnnotation();
                break;
            case strcasecmp($name, 'mock') === 0:
                $annotation = new MockAnnotation();
                break;
            case strcasecmp($name, 'params') === 0:
                $annotation = new ParamsAnnotation();
                break;
            case strcasecmp(substr($name, 0, 6), 'assert') === 0:
                $annotation = new AssertAnnotation();
                break;
            default:
                throw new AnnotationParseException(
                    sprintf('Annotation of name "%s" is unknown', $name)
                );
        }
        $annotation->setName($name);
        $annotation->setLine($line);
        return $annotation;
    }
public function invoke(string $name, int $line): AnnotationInterface
    {
        $name = preg_replace('/@(?i)(PhpUnitGen|Pug)\\\\/', '', $name);
        switch (true) {
            case strcasecmp($name, 'get') === 0:
                $annotation = new GetAnnotation();
                break;
            case strcasecmp($name, 'set') === 0:
                $annotation = new SetAnnotation();
                break;
            case strcasecmp($name, 'construct') === 0:
                $annotation = new ConstructAnnotation();
                break;
            case strcasecmp($name, 'mock') === 0:
                $annotation = new MockAnnotation();
                break;
            case strcasecmp($name, 'params') === 0:
                $annotation = new ParamsAnnotation();
                break;
            case strcasecmp(substr($name, 0, 6), 'assert') === 0:
                $annotation = new AssertAnnotation();
                break;
            default:
                throw new AnnotationParseException(
                    sprintf('Annotation of name "%s" is unknown', $name)
                );
        }
        $annotation->setName($name);
        $annotation->setLine($line);
        return $annotation;
    }
public function invoke ( string $ name , int $ line ) : AnnotationInterface { $ name = preg_replace ( '/@(?i)(PhpUnitGen|Pug)\\\\/' , '' , $ name ) ; switch ( true ) { case strcasecmp ( $ name , 'get' ) === 0 : $ annotation = new GetAnnotation ( ) ; break ; case strcasecmp ( $ name , 'set' ) === 0 : $ annotation = new SetAnnotation ( ) ; break ; case strcasecmp ( $ name , 'construct' ) === 0 : $ annotation = new ConstructAnnotation ( ) ; break ; case strcasecmp ( $ name , 'mock' ) === 0 : $ annotation = new MockAnnotation ( ) ; break ; case strcasecmp ( $ name , 'params' ) === 0 : $ annotation = new ParamsAnnotation ( ) ; break ; case strcasecmp ( substr ( $ name , 0 , 6 ) , 'assert' ) === 0 : $ annotation = new AssertAnnotation ( ) ; break ; default : throw new AnnotationParseException ( sprintf ( 'Annotation of name "%s" is unknown' , $ name ) ) ; } $ annotation -> setName ( $ name ) ; $ annotation -> setLine ( $ line ) ; return $ annotation ; }
Build an annotation from a name and a content.

@param string $name The annotation name (such as "@PhpUnitGen\AssertEquals").
@param int    $line The line number in documentation block.

@return AnnotationInterface The new built annotation.

@throws AnnotationParseException If the annotation is unknown.
Build an annotation from a name and a content .