Completed
Pull Request — master (#118)
by Christoffer
02:16
created

SupportedRules   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

1 Method

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