Commit a4f85eb4 authored by catch's avatar catch

Issue #2143011 by damiankloip: Add a CacheFactoryInterface.

parent 01b27e25
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
class CacheFactory extends ContainerAware { class CacheFactory extends ContainerAware implements CacheFactoryInterface {
/** /**
* The settings array. * The settings array.
......
<?php
/**
* @file
* Contains \Drupal\Core\Cache\CacheFactoryInterface.
*/
namespace Drupal\Core\Cache;
/**
* An interface defining cache factory classes.
*/
interface CacheFactoryInterface {
/**
* Gets a cache backend class for a given cache bin.
*
* @param string $bin
* The cache bin for which a cache backend object should be returned.
*
* @return \Drupal\Core\Cache\CacheBackendInterface
* The cache backend object associated with the specified bin.
*/
public function get($bin);
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
class DatabaseBackendFactory { class DatabaseBackendFactory implements CacheFactoryInterface {
/** /**
* The database connection. * The database connection.
......
...@@ -7,16 +7,10 @@ ...@@ -7,16 +7,10 @@
namespace Drupal\Core\Cache; namespace Drupal\Core\Cache;
class MemoryBackendFactory { class MemoryBackendFactory implements CacheFactoryInterface {
/** /**
* Gets MemoryBackend for the specified cache bin. * {@inheritdoc}
*
* @param $bin
* The cache bin for which the object is created.
*
* @return \Drupal\Core\Cache\MemoryBackend
* The cache backend object for the specified cache bin.
*/ */
function get($bin) { function get($bin) {
return new MemoryBackend($bin); return new MemoryBackend($bin);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment