QueryException::getErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Arthem\GraphQLMapper\Exception;
3
4
use GraphQL\FormattedError;
5
6
class QueryException extends \RuntimeException
7
{
8
    /**
9
     * @var FormattedError[]
10
     */
11
    private $errors;
12
13
    /**
14
     * @param FormattedError[] $errors
15
     * @param string           $message
16
     * @param int              $code
17
     * @param \Exception|null  $previous
18
     */
19
    public function __construct(array $errors, $message = '', $code = 0, \Exception $previous = null)
20
    {
21
        parent::__construct($message, $code, $previous);
22
        $this->errors = $errors;
23
    }
24
25
    /**
26
     * @return FormattedError[]
27
     */
28
    public function getErrors()
29
    {
30
        return $this->errors;
31
    }
32
}
33