minor #18647 [Cache] Minor cleanup (nicolas-grekas)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Minor cleanup

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

5786f3d [Cache] Minor cleanup
This commit is contained in:
Nicolas Grekas 2016-04-27 09:23:25 +02:00
commit e0696fadee
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));
}
}