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

AddErrorMiddleware   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
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