Passed
Pull Request — master (#159)
by Christoffer
03:39
created

SupportedRules   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 9 2
1
<?php
2
3
namespace Digia\GraphQL\SchemaValidation\Rule;
4
5
use Digia\GraphQL\GraphQL;
6
7
class SupportedRules
8
{
9
    /**
10
     * @var array
11
     */
12
    private static $supportedRules = [
13
        RootTypesRule::class,
14
        DirectivesRule::class,
15
        TypesRule::class,
16
    ];
17
18
    /**
19
     * Rules maintain state so they should always be re-instantiated.
20
     *
21
     * @return RuleInterface[]
22
     */
23
    public static function build(): array
24
    {
25
        $rules = [];
26
27
        foreach (self::$supportedRules as $className) {
28
            $rules[] = GraphQL::make($className);
29
        }
30
31
        return $rules;
32
    }
33
}
34