Fixes #14081: Added yii\caching\CacheInterface to make custom cache extensions adoption easier

This commit is contained in:
SilverFire - Dmitry Naumenko
2017-05-01 16:18:18 +03:00
committed by Alexander Makarov
parent 2b7e8be1e8
commit cb53b2feec
22 changed files with 249 additions and 61 deletions

View File

@ -42,7 +42,7 @@ abstract class Dependency extends \yii\base\Object
/**
* Evaluates the dependency by generating and saving the data related with dependency.
* This method is invoked by cache before writing data into it.
* @param Cache $cache the cache component that is currently evaluating this dependency
* @param CacheInterface $cache the cache component that is currently evaluating this dependency
*/
public function evaluateDependency($cache)
{
@ -68,7 +68,7 @@ abstract class Dependency extends \yii\base\Object
/**
* Checks whether the dependency is changed
* @param Cache $cache the cache component that is currently evaluating this dependency
* @param CacheInterface $cache the cache component that is currently evaluating this dependency
* @return bool whether the dependency has changed.
* @since 2.0.11
*/
@ -111,7 +111,7 @@ abstract class Dependency extends \yii\base\Object
/**
* Generates the data needed to determine if dependency is changed.
* Derived classes should override this method to generate the actual dependency data.
* @param Cache $cache the cache component that is currently evaluating this dependency
* @param CacheInterface $cache the cache component that is currently evaluating this dependency
* @return mixed the data needed to determine if dependency has been changed.
*/
abstract protected function generateDependencyData($cache);