ResolvesTypeTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTypeResolver() 0 3 1
A resolveType() 0 3 1
1
<?php
2
3
namespace Digia\Lumen\GraphQL\Traits;
4
5
use Digia\Lumen\GraphQL\Contracts\TypeResolverInterface;
6
7
trait ResolvesTypeTrait
8
{
9
10
    /**
11
     * @param mixed $entity
12
     *
13
     * @return string
14
     */
15
    protected function resolveType($entity)
16
    {
17
        return $this->getTypeResolver()->resolveType($entity);
18
    }
19
20
    /**
21
     * @return TypeResolverInterface
22
     */
23
    protected function getTypeResolver()
24
    {
25
        return app(TypeResolverInterface::class);
26
    }
27
}
28