Passed
Push — develop ( 5def3e...6cdbbb )
by Paul
02:27
created

MockAnnotation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A compile() 0 2 1
1
<?php
2
3
namespace PhpUnitGen\Annotation;
4
5
use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
6
use PhpUnitGen\Exception\AnnotationParseException;
7
use Respect\Validation\Validator;
8
9
/**
10
 * Class MockAnnotation.
11
 *
12
 * @author     Paul Thébaud <[email protected]>.
13
 * @copyright  2017-2018 Paul Thébaud <[email protected]>.
14
 * @license    https://opensource.org/licenses/MIT The MIT license.
15
 * @link       https://github.com/paul-thebaud/phpunit-generator
16
 * @since      Class available since Release 2.0.0.
17
 */
18
class MockAnnotation extends AbstractAnnotation
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getType(): int
24
    {
25
        return AnnotationInterface::TYPE_MOCK;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function compile(): void
32
    {
33
        /*
34
        if ($this->getStringContent() !== null
35
            && ! Validator::regex('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/')
36
                ->validate($this->getStringContent())
37
        ) {
38
            throw new AnnotationParseException(sprintf(
39
                'The annotation at line %d of documentation contains an invalid property name.',
40
                $this->getLine()
41
            ));
42
        }
43
        */
44
    }
45
}
46