Total Complexity | 8 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | final class SymfonyCacheFactory implements CacheFactory |
||
14 | { |
||
15 | 12 | public function make(array $config): CacheItemPoolInterface |
|
18 | } |
||
19 | |||
20 | 12 | private function createAdapter(array $config): CacheItemPoolInterface |
|
21 | { |
||
22 | 12 | if (!isset($config['driver'])) { |
|
23 | 3 | $config['driver'] = 'filesystem'; |
|
24 | } |
||
25 | 12 | switch ($config['driver']) { |
|
26 | 12 | case 'array': |
|
27 | 3 | $driver = $this->createArrayAdapter($config); |
|
28 | 3 | break; |
|
29 | 9 | case 'apcu': |
|
30 | 3 | $driver = $this->createApcuAdapter($config); |
|
31 | 3 | break; |
|
32 | default: |
||
33 | 6 | $driver = $this->createFilesystemAdapter($config); |
|
34 | 6 | break; |
|
35 | } |
||
36 | 12 | return $driver; |
|
37 | } |
||
38 | |||
39 | 6 | private function createFilesystemAdapter(array $config): FilesystemAdapter |
|
|
|||
40 | { |
||
41 | 6 | return new FilesystemAdapter(); |
|
42 | } |
||
43 | |||
44 | 3 | private function createArrayAdapter(array $config): ArrayAdapter |
|
47 | } |
||
48 | |||
49 | 3 | private function createApcuAdapter(array $config): ApcuAdapter |
|
52 | } |
||
53 | } |
||
54 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.