diff --git a/core/lib/Drupal/Core/Controller/ControllerBase.php b/core/lib/Drupal/Core/Controller/ControllerBase.php index fb0f1d4..389279a 100644 --- a/core/lib/Drupal/Core/Controller/ControllerBase.php +++ b/core/lib/Drupal/Core/Controller/ControllerBase.php @@ -15,12 +15,12 @@ * * Controllers that use this base class have access to a number of utility * methods and to the Container, which can greatly reduce boilerplate dependency - * handling code. However, it also renders the class impossible to unit test. - * Therefore this base class should only be used by controller classes that - * contain only trivial glue code. Controllers that contain sufficiently - * complex logic that it's worth testing should not use this base class but - * use ControllerInterface instead, or even better be refactored to be trivial - * glue code. + * handling code. However, it also makes the class considerably more + * difficult to unit test. Therefore this base class should only be used by + * controller classes that contain only trivial glue code. Controllers that + * contain sufficiently complex logic that it's worth testing should not use + * this base class but use ControllerInterface instead, or even better be + * refactored to be trivial glue code. * * The services exposed here are those that it is reasonable for a well-behaved * controller to leverage. A controller that needs other other services may @@ -56,19 +56,6 @@ protected function cache($bin = 'cache') { } /** - * Returns an expirable key value store collection. - * - * @param string $collection - * The name of the collection holding key and value pairs. - * - * @return \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface - * An expirable key value store collection. - */ - protected function keyValueExpirable($collection) { - return $this->container->get('keyvalue.expirable')->get($collection); - } - - /** * Retrieves a configuration object. * * This is the main entry point to the configuration API. Calling diff --git a/core/lib/Drupal/Core/Controller/ControllerInterface.php b/core/lib/Drupal/Core/Controller/ControllerInterface.php index c490f9c..5cdab2e 100644 --- a/core/lib/Drupal/Core/Controller/ControllerInterface.php +++ b/core/lib/Drupal/Core/Controller/ControllerInterface.php @@ -17,8 +17,8 @@ * a lot of boilerplate code in the class. As an alternative, controllers that * contain only limited glue code ("thin" controllers) should instead extend * ControllerBase as that allows direct access to the container. That renders - * the controller un-unit-testable so should only be used for controllers that - * are trivial in complexity. + * the controller very difficult to unit test so should only be used for + * controllers that are trivial in complexity. */ interface ControllerInterface {