Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Factory |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @param string $file |
||
10 | * @param string $type |
||
11 | * |
||
12 | * @return StorageInterface |
||
13 | */ |
||
14 | public function storage(string $file, string $type): StorageInterface |
||
15 | { |
||
16 | switch ($type) { |
||
17 | case 'runtime': |
||
18 | $result = new StorageRuntime($file); |
||
19 | break; |
||
20 | case 'file': |
||
21 | default: |
||
22 | $result = new StorageFile($file); |
||
23 | break; |
||
24 | } |
||
25 | |||
26 | return $result; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param StorageInterface $storage |
||
31 | * |
||
32 | * @return Collection |
||
33 | */ |
||
34 | public function collection(StorageInterface $storage): Collection |
||
37 | } |
||
38 | } |
||
39 |