1 | <?php |
||
5 | class InMemoryServiceRepository implements ServiceRepositoryInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var array $serviceStore |
||
9 | */ |
||
10 | private $serviceStore; |
||
11 | |||
12 | /** |
||
13 | * @inheritdoc |
||
14 | */ |
||
15 | 5 | public function get($serviceId) |
|
16 | { |
||
17 | 5 | if(!isset($this->serviceStore[$serviceId]) || !isset($serviceId)){ |
|
18 | 4 | return Null; |
|
19 | } |
||
20 | |||
21 | 2 | return $this->serviceStore[$serviceId]; |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @inheritdoc |
||
26 | */ |
||
27 | 2 | public function add($id, $service) |
|
31 | } |
||
32 |