@@ -47,17 +47,17 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $cache = $this->configuration->get('cache');
|
| 49 | 49 | |
| 50 | - $algorithm = self::getAlgorithm( empty($cache['algorithm']) ? null : $cache['algorithm']); |
|
| 50 | + $algorithm = self::getAlgorithm(empty($cache['algorithm']) ? null : $cache['algorithm']); |
|
| 51 | 51 | |
| 52 | 52 | $manager = new Cache($algorithm, $this->logger); |
| 53 | 53 | |
| 54 | - if ( !empty($cache) && !empty($cache['providers']) && is_array($cache['providers']) ) {
|
|
| 54 | + if (!empty($cache) && !empty($cache['providers']) && is_array($cache['providers'])) {
|
|
| 55 | 55 | |
| 56 | 56 | foreach ($cache['providers'] as $provider => $parameters) {
|
| 57 | 57 | |
| 58 | 58 | list($handler, $weight) = $this->getHandler($provider, $parameters); |
| 59 | 59 | |
| 60 | - if ( $handler instanceof ProviderInterface ) $manager->addProvider($handler, $weight); |
|
| 60 | + if ($handler instanceof ProviderInterface) $manager->addProvider($handler, $weight); |
|
| 61 | 61 | |
| 62 | 62 | } |
| 63 | 63 | |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | protected function getHandler($provider, $parameters) {
|
| 84 | 84 | |
| 85 | - if ( empty($parameters['type']) ) return array(null, null); |
|
| 85 | + if (empty($parameters['type'])) return array(null, null); |
|
| 86 | 86 | |
| 87 | 87 | $weight = empty($parameters['weight']) ? 0 : $parameters['weight']; |
| 88 | 88 | |
| 89 | - switch ( $parameters['type'] ) {
|
|
| 89 | + switch ($parameters['type']) {
|
|
| 90 | 90 | |
| 91 | 91 | case 'Filesystem': |
| 92 | 92 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $base = $this->configuration->get('base-path');
|
| 127 | 127 | |
| 128 | - if ( empty($parameters['folder']) || empty($base) ) {
|
|
| 128 | + if (empty($parameters['folder']) || empty($base)) {
|
|
| 129 | 129 | $this->logger->warning("Wrong cache provider, disabling $provider", $parameters);
|
| 130 | 130 | return null; |
| 131 | 131 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | $algorithm = strtoupper($algorithm); |
| 176 | 176 | |
| 177 | - if ( array_key_exists($algorithm, self::$algorithms) ) return self::$algorithms[$algorithm]; |
|
| 177 | + if (array_key_exists($algorithm, self::$algorithms)) return self::$algorithms[$algorithm]; |
|
| 178 | 178 | |
| 179 | 179 | return self::$algorithms['PICK_FIRST']; |
| 180 | 180 | |
@@ -57,7 +57,9 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | list($handler, $weight) = $this->getHandler($provider, $parameters); |
| 59 | 59 | |
| 60 | - if ( $handler instanceof ProviderInterface ) $manager->addProvider($handler, $weight); |
|
| 60 | + if ( $handler instanceof ProviderInterface ) { |
|
| 61 | + $manager->addProvider($handler, $weight); |
|
| 62 | + } |
|
| 61 | 63 | |
| 62 | 64 | } |
| 63 | 65 | |
@@ -82,7 +84,9 @@ discard block |
||
| 82 | 84 | |
| 83 | 85 | protected function getHandler($provider, $parameters) {
|
| 84 | 86 | |
| 85 | - if ( empty($parameters['type']) ) return array(null, null); |
|
| 87 | + if ( empty($parameters['type']) ) { |
|
| 88 | + return array(null, null); |
|
| 89 | + } |
|
| 86 | 90 | |
| 87 | 91 | $weight = empty($parameters['weight']) ? 0 : $parameters['weight']; |
| 88 | 92 | |
@@ -174,7 +178,9 @@ discard block |
||
| 174 | 178 | |
| 175 | 179 | $algorithm = strtoupper($algorithm); |
| 176 | 180 | |
| 177 | - if ( array_key_exists($algorithm, self::$algorithms) ) return self::$algorithms[$algorithm]; |
|
| 181 | + if ( array_key_exists($algorithm, self::$algorithms) ) { |
|
| 182 | + return self::$algorithms[$algorithm]; |
|
| 183 | + } |
|
| 178 | 184 | |
| 179 | 185 | return self::$algorithms['PICK_FIRST']; |
| 180 | 186 | |