summaryrefslogtreecommitdiff
path: root/vendor/symfony/cache/Simple/AbstractCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/cache/Simple/AbstractCache.php')
-rw-r--r--vendor/symfony/cache/Simple/AbstractCache.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/symfony/cache/Simple/AbstractCache.php b/vendor/symfony/cache/Simple/AbstractCache.php
index e3fc790479..f29eb69c9b 100644
--- a/vendor/symfony/cache/Simple/AbstractCache.php
+++ b/vendor/symfony/cache/Simple/AbstractCache.php
@@ -15,8 +15,8 @@ use Psr\Log\LoggerAwareInterface;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\CacheItem;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
-use Symfony\Component\Cache\Traits\AbstractTrait;
use Symfony\Component\Cache\ResettableInterface;
+use Symfony\Component\Cache\Traits\AbstractTrait;
/**
* @author Nicolas Grekas <p@tchwork.com>
@@ -39,8 +39,8 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re
{
$this->defaultLifetime = max(0, (int) $defaultLifetime);
$this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace).':';
- if (null !== $this->maxIdLength && strlen($namespace) > $this->maxIdLength - 24) {
- throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")', $this->maxIdLength - 24, strlen($namespace), $namespace));
+ if (null !== $this->maxIdLength && \strlen($namespace) > $this->maxIdLength - 24) {
+ throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")', $this->maxIdLength - 24, \strlen($namespace), $namespace));
}
}
@@ -80,7 +80,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re
if ($keys instanceof \Traversable) {
$keys = iterator_to_array($keys, false);
} 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)));
+ throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
}
$ids = array();
@@ -104,7 +104,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re
public function setMultiple($values, $ttl = null)
{
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)));
+ throw new InvalidArgumentException(sprintf('Cache values must be array or Traversable, "%s" given', \is_object($values) ? \get_class($values) : \gettype($values)));
}
$valuesById = array();
@@ -127,7 +127,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re
}
$keys = array();
foreach (\is_array($e) ? $e : array_keys($valuesById) as $id) {
- $keys[] = substr($id, strlen($this->namespace));
+ $keys[] = substr($id, \strlen($this->namespace));
}
CacheItem::log($this->logger, 'Failed to save values', array('keys' => $keys, 'exception' => $e instanceof \Exception ? $e : null));
@@ -142,7 +142,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re
if ($keys instanceof \Traversable) {
$keys = iterator_to_array($keys, false);
} 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)));
+ throw new InvalidArgumentException(sprintf('Cache keys must be array or Traversable, "%s" given', \is_object($keys) ? \get_class($keys) : \gettype($keys)));
}
return $this->deleteItems($keys);
@@ -160,7 +160,7 @@ abstract class AbstractCache implements CacheInterface, LoggerAwareInterface, Re
return 0 < $ttl ? $ttl : false;
}
- throw new InvalidArgumentException(sprintf('Expiration date must be an integer, a DateInterval or null, "%s" given', is_object($ttl) ? get_class($ttl) : gettype($ttl)));
+ throw new InvalidArgumentException(sprintf('Expiration date must be an integer, a DateInterval or null, "%s" given', \is_object($ttl) ? \get_class($ttl) : \gettype($ttl)));
}
private function generateValues($values, &$keys, $default)