Code Duplication    Length = 18-22 lines in 2 locations

src/Exception/Parser/AbstractParserError.php 1 location

@@ 15-32 (lines=18) @@
12
use Youshido\GraphQL\Exception\Interfaces\LocationableExceptionInterface;
13
use Youshido\GraphQL\Parser\Location;
14
15
abstract class AbstractParserError extends \Exception implements LocationableExceptionInterface
16
{
17
18
    /** @var Location */
19
    private $location;
20
21
    public function __construct($message, Location $location)
22
    {
23
        parent::__construct($message);
24
25
        $this->location = $location;
26
    }
27
28
    public function getLocation()
29
    {
30
        return $this->location;
31
    }
32
}

src/Exception/ResolveException.php 1 location

@@ 15-36 (lines=22) @@
12
use Youshido\GraphQL\Exception\Interfaces\LocationableExceptionInterface;
13
use Youshido\GraphQL\Parser\Location;
14
15
class ResolveException extends \Exception implements LocationableExceptionInterface
16
{
17
18
    /** @var  Location */
19
    private $location;
20
21
    public function __construct($message, Location $location = null)
22
    {
23
        parent::__construct($message);
24
25
        $this->location = $location;
26
    }
27
28
29
    /**
30
     * @return Location
31
     */
32
    public function getLocation()
33
    {
34
        return $this->location;
35
    }
36
}