Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

Motivation:
After we finished the change record of ControllerBase class available for routing controllers to minimize boilerplate code. We realized the remaining interface 'ControllerInterface' will be confusing the new class "ControllerBase":

  • The two names could imply there're some connections between the two interface/class, e.g., ControllerBase implements ControllerInterface. But in fact, they dont' have such direct associations, although they could serve the "Routing Controller" in different scenarios.
  • Code of interface ControllerInterface doesn't actually/literally do anything with "Controllers" or "Routing Controllers". It simply contains a factory method to inject the $container. See WSCCI Conversion Guide for more information about "Routing Controllers". So, we need to keep this interface more generic other than wordly coupled with 'Controllers'.

Solution
Rename interface "ControllerInterface" to "ContainerInjectionInterface" and move its namespace from 'Drupal\Core\Controller' to 'Drupal\Core\DependencyInjection'.

Code change
Before this change, it's

/**
 * @file
 * Contains \Drupal\book\Controller\BookController.
 */

namespace Drupal\book\Controller;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Controller\ControllerInterface;

/**
 * Controller routines for book routes.
 */
class BookController implements ControllerInterface {

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static();
}

Now, it becomes:

/**
 * @file
 * Contains \Drupal\book\Controller\BookController.
 */

namespace Drupal\book\Controller;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;

/**
 * Controller routines for book routes.
 */
class BookController implements ContainerInjectionInterface {

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static();
}
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Generic online documentation done
Theming guide: 
Not done
Module developer documentation: 
Module developer documentation done
Examples project: 
Examples for developers done
Coder Review: 
Coder review done
Coder Upgrade: 
Coder upgrade done
Other: 
Other updates done