Completed
Push — master ( 34956e...ae96c2 )
by Quang
9s
created

AbstractEntityField   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 5 1
1
<?php
2
3
namespace Digia\Lumen\GraphQL\Fields;
4
5
use Digia\Lumen\GraphQL\Models\ResolveContext;
6
use Youshido\GraphQL\Execution\ResolveInfo;
7
use Youshido\GraphQL\Field\AbstractField;
8
9
/**
10
 * Class AbstractEntityField
11
 * @package Digia\Lumen\GraphQL\Fields
12
 */
13
abstract class AbstractEntityField extends AbstractField
14
{
15
16
    /**
17
     * @param ResolveContext $context
18
     * @return mixed
19
     */
20
    abstract protected function resolveEntity(ResolveContext $context);
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function resolve($value, array $args, ResolveInfo $info)
26
    {
27
        $context = new ResolveContext($value, $args, $info);
28
29
        return $this->resolveEntity($context);
30
    }
31
}
32