DeferredResolver::resolve()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
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: 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
}