UnionType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A resolveType() 0 6 1
A getTypes() 0 4 1
1
<?php
2
/*
3
 * This file is a part of GraphQL project.
4
 *
5
 * @author Alexandr Viniychuk <[email protected]>
6
 * created: 11:54 AM 5/5/16
7
 */
8
9
namespace Youshido\GraphQL\Type\Union;
10
11
final class UnionType extends AbstractUnionType
12
{
13
14
    protected $isFinal = true;
15
16 3
    public function resolveType($object)
17
    {
18 3
        $callable = $this->getConfigValue('resolveType');
19
20 3
        return call_user_func_array($callable, [$object]);
21
    }
22
23 4
    public function getTypes()
24
    {
25 4
        return $this->getConfig()->get('types', []);
26
    }
27
28
}
29