feature #19515 [Cache] Drop TaggedCacheItemInterface (nicolas-grekas)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[Cache] Drop TaggedCacheItemInterface

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

Introducing this interface was a mistake, we should drop it: the CacheItem class is final, and it can be instantiated only through a cache adapter. Which means there is no way to reuse this interface in any meaningful way as far as extensibility/interoperability is concerned.

Commits
-------

624890b [Cache] Drop TaggedCacheItemInterface
This commit is contained in:
Fabien Potencier 2016-08-13 11:51:17 -07:00
commit 5cc9ed2048
2 changed files with 9 additions and 36 deletions

View File

@ -11,13 +11,14 @@
namespace Symfony\Component\Cache;
use Psr\Cache\CacheItemInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
/**
* @author Nicolas Grekas <p@tchwork.com>
*/
final class CacheItem implements TaggedCacheItemInterface
final class CacheItem implements CacheItemInterface
{
protected $key;
protected $value;
@ -97,7 +98,13 @@ final class CacheItem implements TaggedCacheItemInterface
}
/**
* {@inheritdoc}
* Adds a tag to a cache item.
*
* @param string|string[] $tags A tag or array of tags
*
* @return static
*
* @throws InvalidArgumentException When $tag is not valid.
*/
public function tag($tags)
{

View File

@ -1,34 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Cache;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\InvalidArgumentException;
/**
* Interface for adding tags to cache items.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
interface TaggedCacheItemInterface extends CacheItemInterface
{
/**
* Adds a tag to a cache item.
*
* @param string|string[] $tags A tag or array of tags
*
* @return static
*
* @throws InvalidArgumentException When $tag is not valid.
*/
public function tag($tags);
}