Completed
Pull Request — master (#29)
by
unknown
01:39
created

Mutation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 27
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __get() 0 4 1
A jsonSerialize() 0 4 1
1
<?php
2
3
namespace Softonic\GraphQL;
4
5
use Softonic\GraphQL\Config\MutationTypeConfig;
6
use Softonic\GraphQL\Mutation\MutationObject;
7
use Softonic\GraphQL\Query\ReadObject;
8
9
class Mutation implements \JsonSerializable
10
{
11
    /**
12
     * @var MutationObject
13
     */
14
    private $mutation;
15
16
    /**
17
     * @param array<MutationTypeConfig> $config
18
     */
19 48
    public function __construct(array $config, ReadObject $source)
20
    {
21 48
        $mutationBuilder = new MutationBuilder($config, $source);
22
23 48
        $this->mutation = $mutationBuilder->build();
24 48
    }
25
26 46
    public function __get(string $key): MutationObject
27
    {
28 46
        return $this->mutation->{$key};
29
    }
30
31 44
    public function jsonSerialize(): array
32
    {
33 44
        return $this->mutation->jsonSerialize();
34
    }
35
}
36