Completed
Pull Request — master (#29)
by
unknown
06:10
created

MutationsConfig   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A get() 0 4 1
1
<?php
2
3
namespace Softonic\GraphQL\Config;
4
5
class MutationsConfig
6
{
7
    /**
8
     * @var array
9
     */
10
    private $mutationsConfig = [];
11
12 52
    public function __construct(array $config)
13
    {
14 52
        foreach ($config as $mutationName => $mutationConfig) {
15 52
            $builder = new MutationConfigBuilder();
16
17 52
            $this->mutationsConfig[$mutationName] = $builder->build($mutationConfig);
18
        }
19 52
    }
20
21
    /**
22
     * @return array<MutationTypeConfig>
23
     */
24 52
    public function get(string $mutationName): array
25
    {
26 52
        return $this->mutationsConfig[$mutationName];
27
    }
28
}
29