diff options
Diffstat (limited to 'vendor/symfony/cache/Simple')
| -rw-r--r-- | vendor/symfony/cache/Simple/AbstractCache.php | 22 | ||||
| -rw-r--r-- | vendor/symfony/cache/Simple/ArrayCache.php | 4 | ||||
| -rw-r--r-- | vendor/symfony/cache/Simple/ChainCache.php | 6 | ||||
| -rw-r--r-- | vendor/symfony/cache/Simple/PdoCache.php | 4 | ||||
| -rw-r--r-- | vendor/symfony/cache/Simple/PhpArrayCache.php | 6 | ||||
| -rw-r--r-- | vendor/symfony/cache/Simple/Psr6Cache.php | 10 | ||||
| -rw-r--r-- | vendor/symfony/cache/Simple/TraceableCache.php | 8 |
7 files changed, 30 insertions, 30 deletions
diff --git a/vendor/symfony/cache/Simple/AbstractCache.php b/vendor/symfony/cache/Simple/AbstractCache.php index 08456f588f..7a2a3cb36e 100644 --- a/vendor/symfony/cache/Simple/AbstractCache.php +++ b/vendor/symfony/cache/Simple/AbstractCache.php @@ -48,11 +48,11 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re $id = $this->getId($key); try { - foreach ($this->doFetch(array($id)) as $value) { + foreach ($this->doFetch([$id]) as $value) { return $value; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch key "{key}"', array('key' => $key, 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to fetch key "{key}"', ['key' => $key, 'exception' => $e]); } return $default; @@ -65,7 +65,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re { CacheItem::validateKey($key); - return $this->setMultiple(array($key => $value), $ttl); + return $this->setMultiple([$key => $value], $ttl); } /** @@ -78,7 +78,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re } elseif (!\is_array($keys)) { throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys))); } - $ids = array(); + $ids = []; foreach ($keys as $key) { $ids[] = $this->getId($key); @@ -86,8 +86,8 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re try { $values = $this->doFetch($ids); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested values', array('keys' => $keys, 'exception' => $e)); - $values = array(); + CacheItem::log($this->logger, 'Failed to fetch requested values', ['keys' => $keys, 'exception' => $e]); + $values = []; } $ids = array_combine($ids, $keys); @@ -102,7 +102,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re if (!\is_array($values) && !$values instanceof \Traversable) { throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values))); } - $valuesById = array(); + $valuesById = []; foreach ($values as $key => $value) { if (\is_int($key)) { @@ -118,14 +118,14 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re $e = $this->doSave($valuesById, $ttl); } catch (\Exception $e) { } - if (true === $e || array() === $e) { + if (true === $e || [] === $e) { return true; } - $keys = array(); + $keys = []; foreach (\is_array($e) ? $e : array_keys($valuesById) as $id) { $keys[] = substr($id, \strlen($this->namespace)); } - CacheItem::log($this->logger, 'Failed to save values', array('keys' => $keys, 'exception' => $e instanceof \Exception ? $e : null)); + CacheItem::log($this->logger, 'Failed to save values', ['keys' => $keys, 'exception' => $e instanceof \Exception ? $e : null]); return false; } @@ -171,7 +171,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re yield $key => $value; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested values', array('keys' => array_values($keys), 'exception' => $e)); + CacheItem::log($this->logger, 'Failed to fetch requested values', ['keys' => array_values($keys), 'exception' => $e]); } foreach ($keys as $key) { diff --git a/vendor/symfony/cache/Simple/ArrayCache.php b/vendor/symfony/cache/Simple/ArrayCache.php index 6785943787..e36dacb829 100644 --- a/vendor/symfony/cache/Simple/ArrayCache.php +++ b/vendor/symfony/cache/Simple/ArrayCache.php @@ -104,7 +104,7 @@ class ArrayCache implements CacheInterface, LoggerAwareInterface, ResettableInte CacheItem::validateKey($key); } - return $this->setMultiple(array($key => $value), $ttl); + return $this->setMultiple([$key => $value], $ttl); } /** @@ -115,7 +115,7 @@ class ArrayCache implements CacheInterface, LoggerAwareInterface, ResettableInte if (!\is_array($values) && !$values instanceof \Traversable) { throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values))); } - $valuesArray = array(); + $valuesArray = []; foreach ($values as $key => $value) { if (!\is_int($key) && !(\is_string($key) && isset($this->expiries[$key]))) { diff --git a/vendor/symfony/cache/Simple/ChainCache.php b/vendor/symfony/cache/Simple/ChainCache.php index 922d0fff31..18e9462ba0 100644 --- a/vendor/symfony/cache/Simple/ChainCache.php +++ b/vendor/symfony/cache/Simple/ChainCache.php @@ -28,7 +28,7 @@ use Symfony\Contracts\Service\ResetInterface; class ChainCache implements CacheInterface, PruneableInterface, ResettableInterface { private $miss; - private $caches = array(); + private $caches = []; private $defaultLifetime; private $cacheCount; @@ -88,7 +88,7 @@ class ChainCache implements CacheInterface, PruneableInterface, ResettableInterf private function generateItems($values, $cacheIndex, $miss, $default) { - $missing = array(); + $missing = []; $nextCacheIndex = $cacheIndex + 1; $nextCache = isset($this->caches[$nextCacheIndex]) ? $this->caches[$nextCacheIndex] : null; @@ -202,7 +202,7 @@ class ChainCache implements CacheInterface, PruneableInterface, ResettableInterf if ($values instanceof \Traversable) { $valuesIterator = $values; $values = function () use ($valuesIterator, &$values) { - $generatedValues = array(); + $generatedValues = []; foreach ($valuesIterator as $key => $value) { yield $key => $value; diff --git a/vendor/symfony/cache/Simple/PdoCache.php b/vendor/symfony/cache/Simple/PdoCache.php index 076370c97e..521e9b8f2d 100644 --- a/vendor/symfony/cache/Simple/PdoCache.php +++ b/vendor/symfony/cache/Simple/PdoCache.php @@ -37,7 +37,7 @@ class PdoCache extends AbstractCache implements PruneableInterface * * db_time_col: The column where to store the timestamp [default: item_time] * * db_username: The username when lazy-connect [default: ''] * * db_password: The password when lazy-connect [default: ''] - * * db_connection_options: An array of driver-specific connection options [default: array()] + * * db_connection_options: An array of driver-specific connection options [default: []] * * @param \PDO|Connection|string $connOrDsn a \PDO or Connection instance or DSN string or null * @@ -45,7 +45,7 @@ class PdoCache extends AbstractCache implements PruneableInterface * @throws InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION * @throws InvalidArgumentException When namespace contains invalid characters */ - public function __construct($connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = array(), MarshallerInterface $marshaller = null) + public function __construct($connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = [], MarshallerInterface $marshaller = null) { $this->init($connOrDsn, $namespace, $defaultLifetime, $options, $marshaller); } diff --git a/vendor/symfony/cache/Simple/PhpArrayCache.php b/vendor/symfony/cache/Simple/PhpArrayCache.php index b913aee2b7..6ba8527885 100644 --- a/vendor/symfony/cache/Simple/PhpArrayCache.php +++ b/vendor/symfony/cache/Simple/PhpArrayCache.php @@ -147,7 +147,7 @@ class PhpArrayCache implements CacheInterface, PruneableInterface, ResettableInt } $deleted = true; - $fallbackKeys = array(); + $fallbackKeys = []; foreach ($keys as $key) { if (!\is_string($key)) { @@ -196,7 +196,7 @@ class PhpArrayCache implements CacheInterface, PruneableInterface, ResettableInt } $saved = true; - $fallbackValues = array(); + $fallbackValues = []; foreach ($values as $key => $value) { if (!\is_string($key) && !\is_int($key)) { @@ -219,7 +219,7 @@ class PhpArrayCache implements CacheInterface, PruneableInterface, ResettableInt private function generateItems(array $keys, $default) { - $fallbackKeys = array(); + $fallbackKeys = []; foreach ($keys as $key) { if (isset($this->keys[$key])) { diff --git a/vendor/symfony/cache/Simple/Psr6Cache.php b/vendor/symfony/cache/Simple/Psr6Cache.php index 6330a4fadc..fceb9ba70f 100644 --- a/vendor/symfony/cache/Simple/Psr6Cache.php +++ b/vendor/symfony/cache/Simple/Psr6Cache.php @@ -147,14 +147,14 @@ class Psr6Cache implements CacheInterface, PruneableInterface, ResettableInterfa } catch (Psr6CacheException $e) { throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); } - $values = array(); + $values = []; if (!$this->pool instanceof AdapterInterface) { foreach ($items as $key => $item) { $values[$key] = $item->isHit() ? $item->get() : $default; } - return $value; + return $values; } foreach ($items as $key => $item) { @@ -170,7 +170,7 @@ class Psr6Cache implements CacheInterface, PruneableInterface, ResettableInterfa unset($metadata[CacheItem::METADATA_TAGS]); if ($metadata) { - $values[$key] = array("\x9D".pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME])."\x5F" => $values[$key]); + $values[$key] = ["\x9D".pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME])."\x5F" => $values[$key]]; } } @@ -186,7 +186,7 @@ class Psr6Cache implements CacheInterface, PruneableInterface, ResettableInterfa if (!$valuesIsArray && !$values instanceof \Traversable) { throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values))); } - $items = array(); + $items = []; try { if (null !== $f = $this->createCacheItem) { @@ -195,7 +195,7 @@ class Psr6Cache implements CacheInterface, PruneableInterface, ResettableInterfa $items[$key] = $f($key, $value, true); } } elseif ($valuesIsArray) { - $items = array(); + $items = []; foreach ($values as $key => $value) { $items[] = (string) $key; } diff --git a/vendor/symfony/cache/Simple/TraceableCache.php b/vendor/symfony/cache/Simple/TraceableCache.php index d6ed40f443..2db335ac96 100644 --- a/vendor/symfony/cache/Simple/TraceableCache.php +++ b/vendor/symfony/cache/Simple/TraceableCache.php @@ -25,7 +25,7 @@ class TraceableCache implements CacheInterface, PruneableInterface, ResettableIn { private $pool; private $miss; - private $calls = array(); + private $calls = []; public function __construct(CacheInterface $pool) { @@ -100,7 +100,7 @@ class TraceableCache implements CacheInterface, PruneableInterface, ResettableIn public function setMultiple($values, $ttl = null) { $event = $this->start(__FUNCTION__); - $event->result['keys'] = array(); + $event->result['keys'] = []; if ($values instanceof \Traversable) { $values = function () use ($values, $event) { @@ -134,7 +134,7 @@ class TraceableCache implements CacheInterface, PruneableInterface, ResettableIn $event->end = microtime(true); } $f = function () use ($result, $event, $miss, $default) { - $event->result = array(); + $event->result = []; foreach ($result as $key => $value) { if ($event->result[$key] = $miss !== $value) { ++$event->hits; @@ -217,7 +217,7 @@ class TraceableCache implements CacheInterface, PruneableInterface, ResettableIn try { return $this->calls; } finally { - $this->calls = array(); + $this->calls = []; } } |
