diff --git a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php index 4484e9f84f6..532f690cac5 100644 --- a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php +++ b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php @@ -20,14 +20,12 @@ class DatabaseStorage extends StorageBase { * * @param string $collection * The name of the collection holding key and value pairs. - * @param array $options - * An associative array of options for the key/value storage collection. - * Keys used: - * - table. The name of the SQL table to use, defaults to key_value. + * @param string $table + * The name of the SQL table to use, defaults to key_value. */ - public function __construct($collection, array $options = array()) { - parent::__construct($collection, $options); - $this->table = isset($options['table']) ? $options['table'] : 'key_value'; + public function __construct($collection, $table = 'key_value') { + parent::__construct($collection); + $this->table = $table; } /** diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreInterface.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreInterface.php index 9e7bb34a7d9..d3504722ddf 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreInterface.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueStoreInterface.php @@ -12,16 +12,6 @@ namespace Drupal\Core\KeyValueStore; */ interface KeyValueStoreInterface { - /** - * Constructs a new key/value collection. - * - * @param string $collection - * The name of the collection holding key and value pairs. - * @param array $options - * An associative array of options for the key/value storage collection. - */ - public function __construct($collection, array $options = array()); - /** * Returns the name of this collection. * diff --git a/core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php b/core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php index 472400591f9..ef3ef0e1a15 100644 --- a/core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php +++ b/core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php @@ -9,11 +9,8 @@ namespace Drupal\Core\KeyValueStore; /** * Defines a default key/value store implementation. - * - * For performance reasons, this implementation is not based on - * Drupal\Core\KeyValueStore\StorageBase. */ -class MemoryStorage implements KeyValueStoreInterface { +class MemoryStorage extends StorageBase { /** * The actual storage of key-value pairs. @@ -22,20 +19,6 @@ class MemoryStorage implements KeyValueStoreInterface { */ protected $data = array(); - /** - * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::__construct(). - */ - public function __construct($collection, array $options = array()) { - $this->collection = $collection; - } - - /** - * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getCollectionName(). - */ - public function getCollectionName() { - return $this->collection; - } - /** * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::get(). */ diff --git a/core/lib/Drupal/Core/KeyValueStore/StorageBase.php b/core/lib/Drupal/Core/KeyValueStore/StorageBase.php index d3bd35c517e..6b643983e95 100644 --- a/core/lib/Drupal/Core/KeyValueStore/StorageBase.php +++ b/core/lib/Drupal/Core/KeyValueStore/StorageBase.php @@ -22,7 +22,7 @@ abstract class StorageBase implements KeyValueStoreInterface { /** * Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::__construct(). */ - public function __construct($collection, array $options = array()) { + public function __construct($collection) { $this->collection = $collection; }