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