summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-kernel/HttpCache/Store.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/http-kernel/HttpCache/Store.php')
-rw-r--r--vendor/symfony/http-kernel/HttpCache/Store.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/vendor/symfony/http-kernel/HttpCache/Store.php b/vendor/symfony/http-kernel/HttpCache/Store.php
index 925ca96fd4..0ca14c7590 100644
--- a/vendor/symfony/http-kernel/HttpCache/Store.php
+++ b/vendor/symfony/http-kernel/HttpCache/Store.php
@@ -38,7 +38,7 @@ class Store implements StoreInterface
throw new \RuntimeException(sprintf('Unable to create the store directory (%s).', $this->root));
}
$this->keyCache = new \SplObjectStorage();
- $this->locks = array();
+ $this->locks = [];
}
/**
@@ -52,7 +52,7 @@ class Store implements StoreInterface
fclose($lock);
}
- $this->locks = array();
+ $this->locks = [];
}
/**
@@ -190,11 +190,11 @@ class Store implements StoreInterface
}
// read existing cache entries, remove non-varying, and add this one to the list
- $entries = array();
+ $entries = [];
$vary = $response->headers->get('vary');
foreach ($this->getMetadata($key) as $entry) {
if (!isset($entry[1]['vary'][0])) {
- $entry[1]['vary'] = array('');
+ $entry[1]['vary'] = [''];
}
if ($entry[1]['vary'][0] != $vary || !$this->requestsMatch($vary, $entry[0], $storedEnv)) {
@@ -205,7 +205,7 @@ class Store implements StoreInterface
$headers = $this->persistResponse($response);
unset($headers['age']);
- array_unshift($entries, array($storedEnv, $headers));
+ array_unshift($entries, [$storedEnv, $headers]);
if (false === $this->save($key, serialize($entries))) {
throw new \RuntimeException('Unable to store the metadata.');
@@ -234,13 +234,13 @@ class Store implements StoreInterface
$modified = false;
$key = $this->getCacheKey($request);
- $entries = array();
+ $entries = [];
foreach ($this->getMetadata($key) as $entry) {
$response = $this->restoreResponse($entry[1]);
if ($response->isFresh()) {
$response->expire();
$modified = true;
- $entries[] = array($entry[0], $this->persistResponse($response));
+ $entries[] = [$entry[0], $this->persistResponse($response)];
} else {
$entries[] = $entry;
}
@@ -291,7 +291,7 @@ class Store implements StoreInterface
private function getMetadata($key)
{
if (!$entries = $this->load($key)) {
- return array();
+ return [];
}
return unserialize($entries);
@@ -462,7 +462,7 @@ class Store implements StoreInterface
private function persistResponse(Response $response)
{
$headers = $response->headers->all();
- $headers['X-Status'] = array($response->getStatusCode());
+ $headers['X-Status'] = [$response->getStatusCode()];
return $headers;
}
@@ -481,7 +481,7 @@ class Store implements StoreInterface
unset($headers['X-Status']);
if (null !== $body) {
- $headers['X-Body-File'] = array($body);
+ $headers['X-Body-File'] = [$body];
}
return new Response($body, $status, $headers);