UnionType::getTypes()   A
last analyzed

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
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 0
crap 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