DeferredResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A resolve() 0 3 1
1
<?php
2
/**
3
 * This file is a part of GraphQL project.
4
 *
5
 * @author Alexandr Viniychuk <[email protected]>
6
 * created: 4/24/17 11:50 PM
7
 */
8
9
namespace Youshido\GraphQL\Execution;
10
11
12
/**
13
 * Default implementation of DeferredResolverInterface
14
 *
15
 * @package Youshido\GraphQL\Execution
16
 */
17
class DeferredResolver implements DeferredResolverInterface {
18
19
    /** @var callable */
20
    private $resolver;
21
22 4
    public function __construct($resolver)
23
    {
24 4
        $this->resolver = $resolver;
25 4
    }
26
27 4
    public function resolve() {
28 4
      return call_user_func($this->resolver);
29
    }
30
}