Completed
Push — master ( 391b65...49cdab )
by David
14s
created

EmptyContainer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
A has() 0 4 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Registry;
5
6
use Psr\Container\ContainerInterface;
7
8
/**
9
 * An always empty container (to use as a stub for the Registry).
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