Code Duplication    Length = 8-9 lines in 2 locations

WebStream/Module/Utility/CacheUtils.php 2 locations

@@ 33-40 (lines=8) @@
30
            case "apcu":
31
                $driver = $factory->create("WebStream\Cache\Driver\Apcu");
32
                break;
33
            case "memcached":
34
                $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot() . '/config/cache.yml');
35
                if (array_key_exists('memcached', $cacheConfig)) {
36
                    $config = new Container(false);
37
                    $config->servers = [$cacheConfig['host'], $cacheConfig['port']];
38
                    $driver = $factory->create("WebStream\Cache\Driver\Memcached", $config);
39
                }
40
                break;
41
            case "redis":
42
                $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot() . '/config/cache.yml');
43
                if (array_key_exists('redis', $cacheConfig)) {
@@ 41-49 (lines=9) @@
38
                    $driver = $factory->create("WebStream\Cache\Driver\Memcached", $config);
39
                }
40
                break;
41
            case "redis":
42
                $cacheConfig = \Spyc::YAMLLoad($this->getApplicationRoot() . '/config/cache.yml');
43
                if (array_key_exists('redis', $cacheConfig)) {
44
                    $config = new Container(false);
45
                    $config->host = $cacheConfig['host'];
46
                    $config->port = $cacheConfig['port'];
47
                    $driver = $factory->create("WebStream\Cache\Driver\Redis", $config);
48
                }
49
                break;
50
            case "temporaryFile":
51
                $config = new Container();
52
                $config->cacheDir = "/tmp";