Completed
Push — master ( 5b603d...f09253 )
by David
12s
created

NotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A notFound() 0 3 1
A notFoundInContainer() 0 3 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Containers;
5
6
use Psr\Container\NotFoundExceptionInterface;
7
8
class NotFoundException extends \RuntimeException implements NotFoundExceptionInterface
9
{
10
    public static function notFound(string $id): NotFoundException
11
    {
12
        return new self('Could not find entry with ID / type with class "'.$id.'"');
13
    }
14
15
    public static function notFoundInContainer(string $id): NotFoundException
16
    {
17
        return new self('GraphQL type "'.$id.'" could not be instantiated automatically. It has a constructor with compulsory parameters. Please create an entry in your container whose name is "'.$id.'"');
18
    }
19
}
20