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

MutationConfig::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Softonic\GraphQL\Config;
4
5
class MutationConfig
6
{
7
    private $configObjects;
8
9 50
    public function __construct(array $config)
10
    {
11 50
        foreach ($config as $mutationName => $mutationConfig) {
12 50
            $this->configObjects[$mutationName] = [];
13 50
            foreach ($mutationConfig as $param => $cfg) {
14 50
                $this->configObjects[$mutationName][$param] = new MutationConfigObject($cfg);
15
            }
16
        }
17 50
    }
18
19
    /**
20
     * @return array<MutationConfigObject>
21
     */
22 50
    public function get(string $mutationName): array
23
    {
24 50
        return $this->configObjects[$mutationName];
25
    }
26
}
27