@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - private $types = [ 'memory' ]; |
|
| 42 | + private $types = ['memory']; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Time-to-live in seconds. |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | return [ |
| 66 | 66 | 'active' => true, |
| 67 | - 'types' => [ 'memory' ], |
|
| 67 | + 'types' => ['memory'], |
|
| 68 | 68 | 'default_ttl' => self::WEEK_IN_SECONDS, |
| 69 | 69 | 'prefix' => self::DEFAULT_NAMESPACE |
| 70 | 70 | ]; |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | 'ttl' => CacheConfig::DAY_IN_SECONDS, |
| 137 | 137 | |
| 138 | 138 | 'included_path' => '*', |
| 139 | - 'excluded_path' => [ '^/admin\b' ], |
|
| 139 | + 'excluded_path' => ['^/admin\b'], |
|
| 140 | 140 | |
| 141 | - 'methods' => [ 'GET' ], |
|
| 142 | - 'status_codes' => [ 200 ], |
|
| 141 | + 'methods' => ['GET'], |
|
| 142 | + 'status_codes' => [200], |
|
| 143 | 143 | |
| 144 | 144 | 'included_query' => null, |
| 145 | 145 | 'excluded_query' => null, |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $uri = $uri->withQuery($queryStr); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - $cacheKey = 'request/' . $request->getMethod() . '/' . md5((string)$uri); |
|
| 250 | + $cacheKey = 'request/'.$request->getMethod().'/'.md5((string)$uri); |
|
| 251 | 251 | return $cacheKey; |
| 252 | 252 | } |
| 253 | 253 | |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | foreach ((array)$this->includedPath as $included) { |
| 293 | - if (preg_match('@' . $included . '@', $path)) { |
|
| 293 | + if (preg_match('@'.$included.'@', $path)) { |
|
| 294 | 294 | return true; |
| 295 | 295 | } |
| 296 | 296 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | foreach ((array)$this->excludedPath as $excluded) { |
| 318 | - if (preg_match('@' . $excluded . '@', $path)) { |
|
| 318 | + if (preg_match('@'.$excluded.'@', $path)) { |
|
| 319 | 319 | return true; |
| 320 | 320 | } |
| 321 | 321 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $driverOptions['servers'] = $servers; |
| 150 | 150 | } else { |
| 151 | 151 | // Default Memcache options: locahost:11211 |
| 152 | - $driverOptions['servers'][] = [ '127.0.0.1', 11211 ]; |
|
| 152 | + $driverOptions['servers'][] = ['127.0.0.1', 11211]; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | return new $drivers['Memcache']($driverOptions); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $container['cache'] = function (Container $container) { |
| 225 | 225 | $cacheBuilder = $container['cache/builder']; |
| 226 | 226 | $cacheConfig = $container['cache/config']; |
| 227 | - $cacheDrivers = array_unique($cacheConfig['types'] + [ 'memory' ]); |
|
| 227 | + $cacheDrivers = array_unique($cacheConfig['types'] + ['memory']); |
|
| 228 | 228 | |
| 229 | 229 | return $cacheBuilder($cacheDrivers); |
| 230 | 230 | }; |