Completed
Pull Request — master (#47)
by David
03:13
created

NotFoundException::notFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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