[Cache] Minor cleanup

This commit is contained in:
Nicolas Grekas 2016-04-27 08:45:20 +02:00
parent 84b48de299
commit 5786f3d532
2 changed files with 1 additions and 2 deletions

View File

@ -323,7 +323,6 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
CacheItem::log($this->logger, 'Failed to save key "{key}" ({type})', array('key' => substr($id, strlen($this->namespace)), 'type' => $type, 'exception' => $e instanceof \Exception ? $e : null));
}
}
$this->deferred = array();
return $ok;
}

View File

@ -115,7 +115,7 @@ final class CacheItem implements CacheItemInterface
throw new InvalidArgumentException('Cache key length must be greater than zero');
}
if (isset($key[strcspn($key, '{}()/\@:')])) {
throw new InvalidArgumentException('Cache key contains reserved characters {}()/\@:');
throw new InvalidArgumentException(sprintf('Cache key "%s" contains reserved characters {}()/\@:', $key));
}
}