Commit 613a370a authored by catch's avatar catch

Issue #2057589 by smiletrl, tim.plunkett, alexpott, dawehner: Rename...

Issue #2057589 by smiletrl, tim.plunkett, alexpott, dawehner: Rename ControllerInterface to ContainerInjectionInterface.
parent c7994001
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* difficult to unit test. Therefore this base class should only be used by * difficult to unit test. Therefore this base class should only be used by
* controller classes that contain only trivial glue code. Controllers that * controller classes that contain only trivial glue code. Controllers that
* contain sufficiently complex logic that it's worth testing should not use * contain sufficiently complex logic that it's worth testing should not use
* this base class but use ControllerInterface instead, or even better be * this base class but use ContainerInjectionInterface instead, or even better be
* refactored to be trivial glue code. * refactored to be trivial glue code.
* *
* The services exposed here are those that it is reasonable for a well-behaved * The services exposed here are those that it is reasonable for a well-behaved
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* need to be refactored into a thin controller and a dependent unit-testable * need to be refactored into a thin controller and a dependent unit-testable
* service. * service.
* *
* @see \Drupal\Core\Controller\ControllerInterface * @see \Drupal\Core\DependencyInjection\ContainerInjectionInterface
*/ */
abstract class ControllerBase extends ContainerAware { abstract class ControllerBase extends ContainerAware {
......
...@@ -129,7 +129,7 @@ protected function createController($controller) { ...@@ -129,7 +129,7 @@ protected function createController($controller) {
throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
} }
// @todo Remove the second in_array() once that interface has been removed. // @todo Remove the second in_array() once that interface has been removed.
if (in_array('Drupal\Core\Controller\ControllerInterface', class_implements($class))) { if (in_array('Drupal\Core\DependencyInjection\ContainerInjectionInterface', class_implements($class))) {
$controller = $class::create($this->container); $controller = $class::create($this->container);
} }
else { else {
......
...@@ -82,7 +82,7 @@ public function content(Request $request, $_form) { ...@@ -82,7 +82,7 @@ public function content(Request $request, $_form) {
protected function getFormObject(Request $request, $form_arg) { protected function getFormObject(Request $request, $form_arg) {
// If this is a class, instantiate it. // If this is a class, instantiate it.
if (class_exists($form_arg)) { if (class_exists($form_arg)) {
if (in_array('Drupal\Core\Controller\ControllerInterface', class_implements($form_arg))) { if (in_array('Drupal\Core\DependencyInjection\ContainerInjectionInterface', class_implements($form_arg))) {
return $form_arg::create($this->container); return $form_arg::create($this->container);
} }
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
/** /**
* @file * @file
* Contains \Drupal\Core\Controller\ControllerInterface. * Contains \Drupal\Core\Controller\ContainerInjectionInterface.
*/ */
namespace Drupal\Core\Controller; namespace Drupal\Core\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* the controller very difficult to unit test so should only be used for * the controller very difficult to unit test so should only be used for
* controllers that are trivial in complexity. * controllers that are trivial in complexity.
*/ */
interface ControllerInterface { interface ContainerInjectionInterface {
/** /**
* Instantiates a new instance of this controller. * Instantiates a new instance of this controller.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\Core\Entity\Controller; namespace Drupal\Core\Entity\Controller;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
/** /**
* Defines a generic controller to render a single entity. * Defines a generic controller to render a single entity.
*/ */
class EntityViewController implements ControllerInterface { class EntityViewController implements ContainerInjectionInterface {
/** /**
* The entity manager * The entity manager
......
...@@ -276,7 +276,7 @@ public function getListController($entity_type) { ...@@ -276,7 +276,7 @@ public function getListController($entity_type) {
public function getFormController($entity_type, $operation) { public function getFormController($entity_type, $operation) {
if (!isset($this->controllers['form'][$operation][$entity_type])) { if (!isset($this->controllers['form'][$operation][$entity_type])) {
$class = $this->getControllerClass($entity_type, 'form', $operation); $class = $this->getControllerClass($entity_type, 'form', $operation);
if (in_array('Drupal\Core\Controller\ControllerInterface', class_implements($class))) { if (in_array('Drupal\Core\DependencyInjection\ContainerInjectionInterface', class_implements($class))) {
$controller = $class::create($this->container); $controller = $class::create($this->container);
} }
else { else {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\Core\Form; namespace Drupal\Core\Form;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
/** /**
* Provides a base class for forms. * Provides a base class for forms.
*/ */
abstract class FormBase implements FormInterface, ControllerInterface { abstract class FormBase implements FormInterface, ContainerInjectionInterface {
/** /**
* The translation manager service. * The translation manager service.
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
use Drupal\aggregator\FeedInterface; use Drupal\aggregator\FeedInterface;
use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Config\ConfigFactory;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** /**
* Returns responses for aggregator module routes. * Returns responses for aggregator module routes.
*/ */
class AggregatorController implements ControllerInterface { class AggregatorController implements ContainerInjectionInterface {
/** /**
* Stores the Entity manager. * Stores the Entity manager.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
namespace Drupal\aggregator\Form; namespace Drupal\aggregator\Form;
use Drupal\aggregator\CategoryStorageControllerInterface; use Drupal\aggregator\CategoryStorageControllerInterface;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Form\ConfirmFormBase;
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/** /**
* Provides a confirm delete form. * Provides a confirm delete form.
*/ */
class CategoryDeleteForm extends ConfirmFormBase implements ControllerInterface { class CategoryDeleteForm extends ConfirmFormBase implements ContainerInjectionInterface {
/** /**
* The category to be deleted. * The category to be deleted.
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
namespace Drupal\custom_block\Controller; namespace Drupal\custom_block\Controller;
use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityStorageControllerInterface;
use Drupal\custom_block\CustomBlockTypeInterface; use Drupal\custom_block\CustomBlockTypeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class CustomBlockController implements ControllerInterface { class CustomBlockController implements ContainerInjectionInterface {
/** /**
* The entity manager. * The entity manager.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace Drupal\book\Controller; namespace Drupal\book\Controller;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\book\BookManager; use Drupal\book\BookManager;
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/** /**
* Controller routines for book routes. * Controller routines for book routes.
*/ */
class BookController implements ControllerInterface { class BookController implements ContainerInjectionInterface {
/** /**
* Book Manager Service. * Book Manager Service.
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
use Drupal\comment\CommentInterface; use Drupal\comment\CommentInterface;
use Drupal\comment\Entity\Comment; use Drupal\comment\Entity\Comment;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\Core\Routing\UrlGeneratorInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* *
* @see \Drupal\comment\Entity\Comment. * @see \Drupal\comment\Entity\Comment.
*/ */
class CommentController implements ControllerInterface { class CommentController implements ContainerInjectionInterface {
/** /**
* The url generator service. * The url generator service.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
use Drupal\comment\CommentStorageControllerInterface; use Drupal\comment\CommentStorageControllerInterface;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Form\ConfirmFormBase;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/** /**
* Provides the comment multiple delete confirmation form. * Provides the comment multiple delete confirmation form.
*/ */
class ConfirmDeleteMultiple extends ConfirmFormBase implements ControllerInterface { class ConfirmDeleteMultiple extends ConfirmFormBase implements ContainerInjectionInterface {
/** /**
* The comment storage. * The comment storage.
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
namespace Drupal\config\Controller; namespace Drupal\config\Controller;
use Drupal\Core\Controller\ControllerInterface;
use Drupal\Core\Config\StorageInterface;
use Drupal\Component\Archiver\ArchiveTar; use Drupal\Component\Archiver\ArchiveTar;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\system\FileDownloadController; use Drupal\system\FileDownloadController;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/** /**
* Returns responses for config module routes. * Returns responses for config module routes.
*/ */
class ConfigController implements ControllerInterface { class ConfigController implements ContainerInjectionInterface {
/** /**
* The target storage. * The target storage.
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
use Drupal\Component\Utility\Xss; use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
use Drupal\Core\Controller\ControllerInterface;
use Drupal\Core\Datetime\Date; use Drupal\Core\Datetime\Date;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\user\UserStorageControllerInterface; use Drupal\user\UserStorageControllerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* Returns responses for dblog routes. * Returns responses for dblog routes.
*/ */
class DbLogController extends ControllerBase implements ControllerInterface { class DbLogController extends ControllerBase implements ContainerInjectionInterface {
/** /**
* The database service. * The database service.
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityManager;
use Drupal\field\FieldInfo; use Drupal\field\FieldInfo;
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/** /**
* Returns responses for Edit module routes. * Returns responses for Edit module routes.
*/ */
class EditController implements ControllerInterface { class EditController implements ContainerInjectionInterface {
/** /**
* The TempStore factory. * The TempStore factory.
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
namespace Drupal\entity\Controller; namespace Drupal\entity\Controller;
use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Provides methods for entity display mode routes. * Provides methods for entity display mode routes.
*/ */
class EntityDisplayModeController implements ControllerInterface { class EntityDisplayModeController implements ContainerInjectionInterface {
/** /**
* The entity manager. * The entity manager.
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
/** /**
* Defines route controller for entity reference. * Defines route controller for entity reference.
*/ */
class EntityReferenceController implements ControllerInterface { class EntityReferenceController implements ContainerInjectionInterface {
/** /**
* The autocomplete helper for entity references. * The autocomplete helper for entity references.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
namespace Drupal\forum\Controller; namespace Drupal\forum\Controller;
use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Config\ConfigFactory;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityManager;
use Drupal\taxonomy\TermStorageControllerInterface; use Drupal\taxonomy\TermStorageControllerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/** /**
* Controller routines for forum routes. * Controller routines for forum routes.
*/ */
class ForumController implements ControllerInterface { class ForumController implements ContainerInjectionInterface {
/** /**
* Entity Manager Service. * Entity Manager Service.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace Drupal\help\Controller; namespace Drupal\help\Controller;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/** /**
* Controller routines for help routes. * Controller routines for help routes.
*/ */
class HelpController implements ControllerInterface { class HelpController implements ContainerInjectionInterface {
/** /**
* Stores the module handler. * Stores the module handler.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
namespace Drupal\image\Controller; namespace Drupal\image\Controller;
use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Crypt;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Image\ImageFactory; use Drupal\Core\Image\ImageFactory;
use Drupal\Core\Lock\LockBackendInterface; use Drupal\Core\Lock\LockBackendInterface;
use Drupal\image\ImageStyleInterface; use Drupal\image\ImageStyleInterface;
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/** /**
* Defines a controller to serve image styles. * Defines a controller to serve image styles.
*/ */
class ImageStyleDownloadController extends FileDownloadController implements ControllerInterface { class ImageStyleDownloadController extends FileDownloadController implements ContainerInjectionInterface {
/** /**
* The lock backend. * The lock backend.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\image\Form; namespace Drupal\image\Form;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\image\ImageEffectManager; use Drupal\image\ImageEffectManager;
use Drupal\image\ImageStyleInterface; use Drupal\image\ImageStyleInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
/** /**
* Provides an add form for image effects. * Provides an add form for image effects.
*/ */
class ImageEffectAddForm extends ImageEffectFormBase implements ControllerInterface { class ImageEffectAddForm extends ImageEffectFormBase implements ContainerInjectionInterface {
/** /**
* The image effect manager. * The image effect manager.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\language_test\Controller; namespace Drupal\language_test\Controller;
use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
/** /**
* Controller routines for language_test routes. * Controller routines for language_test routes.
*/ */
class LanguageTestController implements ControllerInterface { class LanguageTestController implements ContainerInjectionInterface {
/** /**
* The HTTP kernel service. * The HTTP kernel service.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace Drupal\locale\Controller; namespace Drupal\locale\Controller;
use Drupal