diff -u b/core/modules/update/lib/Drupal/update/Controller/UpdateController.php b/core/modules/update/lib/Drupal/update/Controller/UpdateController.php --- b/core/modules/update/lib/Drupal/update/Controller/UpdateController.php +++ b/core/modules/update/lib/Drupal/update/Controller/UpdateController.php @@ -7,10 +7,40 @@ namespace Drupal\update\Controller; +use Drupal\Core\ControllerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** * Controller routines for update routes. */ -class UpdateController { +class UpdateController implements ControllerInterface { + + /** + * Module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** + * Constructs update status data. + * + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * Module Handler Service. + */ + public function __construct(ModuleHandlerInterface $module_handler) { + $this->moduleHandler = $module_handler; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('module_handler') + ); + } /** * Returns a page about the update status of projects. @@ -23,7 +53,7 @@ '#theme' => 'update_report' ); if ($available = update_get_available(TRUE)) { - \Drupal::moduleHandler()->loadInclude('update', 'compare.inc'); + $this->moduleHandler->loadInclude('update', 'compare.inc'); $build['#data'] = update_calculate_project_data($available); } else { diff -u b/core/modules/update/update.module b/core/modules/update/update.module --- b/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -264,12 +264,15 @@ ), 'update_report' => array( 'variables' => array('data' => NULL), + 'file' => 'update.report.inc', ), 'update_version' => array( 'variables' => array('version' => NULL, 'tag' => NULL, 'class' => array()), + 'file' => 'update.report.inc', ), 'update_status_label' => array( 'variables' => array('status' => NULL), + 'file' => 'update.report.inc', ), ); }