Completed
Push — develop ( 84bfed...2b68dc )
by Paul
02:42
created

AnnotationFactory::invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PhpUnitGen\Annotation;
4
5
use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
6
use PhpUnitGen\Exception\AnnotationParseException;
7
8
/**
9
 * Class AnnotationFactory.
10
 *
11
 * @author     Paul Thébaud <[email protected]>.
12
 * @copyright  2017-2018 Paul Thébaud <[email protected]>.
13
 * @license    https://opensource.org/licenses/MIT The MIT license.
14
 * @link       https://github.com/paul-thebaud/phpunit-generator
15
 * @since      Class available since Release 2.0.0.
16
 */
17
class AnnotationFactory
18
{
19
    /**
20
     * Build an annotation from a name and a content.
21
     *
22
     * @param string      $name    The annotation name (such as "@PhpUnitGen\AssertEquals").
23
     * @param int         $line    The line number in documentation block.
24
     *
25
     * @return AnnotationInterface The new built annotation.
26
     */
27
    public function invoke(string $name, int $line): AnnotationInterface
28
    {
29
        /** @todo */
30
        $annotation = new GetterAnnotation();
31
        $annotation->setName($name);
32
        $annotation->setLine($line);
33
        return $annotation;
34
    }
35
}
36