Completed
Pull Request — master (#294)
by Christoffer
02:23
created

ErrorHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\GraphQL\Error;
4
5
class ErrorHandler implements ErrorHandlerInterface
6
{
7
    /**
8
     * @var callable
9
     */
10
    protected $handleCallback;
11
12
    /**
13
     * CallbackErrorHandler constructor.
14
     * @param callable $handleCallback
15
     */
16
    public function __construct(callable $handleCallback)
17
    {
18
        $this->handleCallback = $handleCallback;
19
    }
20
21
    /**
22
     * @param ExecutionException $exception
23
     */
24
    public function handleError(ExecutionException $exception)
25
    {
26
        \call_user_func($this->handleCallback, $exception);
27
    }
28
}
29