Failed Conditions
Pull Request — new-parser-ast-metadata (#2)
by
unknown
02:33
created

ScopeMother   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 15
dl 0
loc 40
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A withNestingLevel() 0 5 1
A example() 0 4 1
A withImports() 0 5 1
A withSubject() 0 5 1
A withIgnoredAnnotations() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\Annotations\Annotation\Parser;
6
7
use Doctrine\Annotations\Parser\Scope;
8
9
final class ScopeMother
10
{
11
    public static function example(): Scope
12
    {
13
        return (new ScopeBuilder())
14
            ->build();
15
    }
16
17
    public static function withSubject(\Reflector $reflector): Scope
18
    {
19
        return (new ScopeBuilder())
20
            ->withSubject($reflector)
21
            ->build();
22
    }
23
24
    /**
25
     * @param string[] $names
26
     */
27
    public static function withIgnoredAnnotations(array $names): Scope
28
    {
29
        return (new ScopeBuilder())
30
            ->withIgnoredAnnotations($names)
31
            ->build();
32
    }
33
34
    /**
35
     * @param array<string,string> $importsMap
36
     */
37
    public static function withImports(array $importsMap): Scope
38
    {
39
        return (new ScopeBuilder())
40
            ->withImports($importsMap)
41
            ->build();
42
    }
43
44
    public static function withNestingLevel(int $level): Scope
45
    {
46
        return (new ScopeBuilder())
47
            ->withNestingLevel($level)
48
            ->build();
49
    }
50
}
51