Passed
Pull Request — master (#318)
by Sam
03:16
created

AddErrorMiddleware::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\GraphQL\Error\Handler;
4
5
use Digia\GraphQL\Execution\ExecutionContext;
6
use Digia\GraphQL\Execution\ExecutionException;
7
8
class AddErrorMiddleware implements ErrorMiddlewareInterface
9
{
10
    /**
11
     * @inheritdoc
12
     */
13
    public function handle(ExecutionException $exception, ExecutionContext $context, callable $next)
14
    {
15
        $context->addError($exception);
16
17
        return $next($exception, $context);
18
    }
19
}
20