EmptyContainer   A
last analyzed

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 get() 0 3 1
A has() 0 3 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Containers;
5
6
use Psr\Container\ContainerInterface;
7
8
/**
9
 * An always empty container (to use as a stub for the BasicAutoWiringContainer).
10
 */
11
class EmptyContainer implements ContainerInterface
12
{
13
    public function get($id)
14
    {
15
        throw NotFoundException::notFound($id);
16
    }
17
18
    public function has($id)
19
    {
20
        return false;
21
    }
22
}
23