diff -u b/core/modules/block/src/BlockForm.php b/core/modules/block/src/BlockForm.php --- b/core/modules/block/src/BlockForm.php +++ b/core/modules/block/src/BlockForm.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityForm; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Executable\ExecutableManagerInterface; -use Drupal\Core\Extension\ThemeHandler; +use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Form\FormState; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageManagerInterface; @@ -78,10 +78,10 @@ * The EventDispatcher for gathering administrative contexts. * @param \Drupal\Core\Language\LanguageManagerInterface $language * The language manager. - * @param \Drupal\Core\Extension\ThemeHandler $theme_handler + * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler. */ - public function __construct(EntityManagerInterface $entity_manager, ExecutableManagerInterface $manager, EventDispatcherInterface $dispatcher, LanguageManagerInterface $language, ThemeHandler $theme_handler) { + public function __construct(EntityManagerInterface $entity_manager, ExecutableManagerInterface $manager, EventDispatcherInterface $dispatcher, LanguageManagerInterface $language, ThemeHandlerInterface $theme_handler) { $this->storage = $entity_manager->getStorage('block'); $this->manager = $manager; $this->dispatcher = $dispatcher; diff -u b/core/modules/block_content/src/Controller/BlockContentController.php b/core/modules/block_content/src/Controller/BlockContentController.php --- b/core/modules/block_content/src/Controller/BlockContentController.php +++ b/core/modules/block_content/src/Controller/BlockContentController.php @@ -11,7 +11,7 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\block_content\BlockContentTypeInterface; -use Drupal\Core\Extension\ThemeHandler; +use Drupal\Core\Extension\ThemeHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -34,7 +34,7 @@ /** * The theme handler. * - * @var \Drupal\Core\Extension\ThemeHandler + * @var \Drupal\Core\Extension\ThemeHandlerInterface */ protected $themeHandler; @@ -57,10 +57,10 @@ * The custom block storage. * @param \Drupal\Core\Entity\EntityStorageInterface $block_content_type_storage * The custom block type storage. - * @param \Drupal\Core\Extension\ThemeHandler $theme_handler + * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler. */ - public function __construct(EntityStorageInterface $block_content_storage, EntityStorageInterface $block_content_type_storage, ThemeHandler $theme_handler) { + public function __construct(EntityStorageInterface $block_content_storage, EntityStorageInterface $block_content_type_storage, ThemeHandlerInterface $theme_handler) { $this->blockContentStorage = $block_content_storage; $this->blockContentTypeStorage = $block_content_type_storage; $this->themeHandler = $theme_handler; diff -u b/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php --- b/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/core/modules/system/src/Form/ThemeSettingsForm.php @@ -7,7 +7,7 @@ namespace Drupal\system\Form; -use Drupal\Core\Extension\ThemeHandler; +use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\StreamWrapper\PublicStream; @@ -33,7 +33,7 @@ /** * The theme handler. * - * @var \Drupal\Core\Extension\ThemeHandler + * @var \Drupal\Core\Extension\ThemeHandlerInterface */ protected $themeHandler; @@ -44,10 +44,10 @@ * The factory for configuration objects. * @param \Drupal\Core\Extension\ModuleHandlerInterface * The module handler instance to use. - * @param \Drupal\Core\Extension\ThemeHandler $theme_handler + * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler. */ - public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, ThemeHandler $theme_handler) { + public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler) { parent::__construct($config_factory); $this->moduleHandler = $module_handler; diff -u b/core/modules/views_ui/src/Form/BasicSettingsForm.php b/core/modules/views_ui/src/Form/BasicSettingsForm.php --- b/core/modules/views_ui/src/Form/BasicSettingsForm.php +++ b/core/modules/views_ui/src/Form/BasicSettingsForm.php @@ -8,7 +8,7 @@ namespace Drupal\views_ui\Form; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Extension\ThemeHandler; +use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,7 +21,7 @@ /** * The theme handler. * - * @var \Drupal\Core\Extension\ThemeHandler + * @var \Drupal\Core\Extension\ThemeHandlerInterface */ protected $themeHandler; @@ -30,10 +30,10 @@ * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The factory for configuration objects. - * @param \Drupal\Core\Extension\ThemeHandler $theme_handler + * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler. */ - public function __construct(ConfigFactoryInterface $config_factory, ThemeHandler $theme_handler) { + public function __construct(ConfigFactoryInterface $config_factory, ThemeHandlerInterface $theme_handler) { parent::__construct($config_factory); $this->themeHandler = $theme_handler; only in patch2: unchanged: --- a/core/modules/block/tests/src/Unit/BlockFormTest.php +++ b/core/modules/block/tests/src/Unit/BlockFormTest.php @@ -44,6 +44,14 @@ class BlockFormTest extends UnitTestCase { */ protected $language; + + /** + * The theme handler. + * + * @var \Drupal\Core\Extension\ThemeHandlerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $themeHandler; + /** * The entity manager. * @@ -63,6 +71,7 @@ protected function setUp() { $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); + $this->themeHandler = $this->getMock('Drupal\Core\Extension\ThemeHandlerInterface'); $this->entityManager->expects($this->any()) ->method('getStorage') ->will($this->returnValue($this->storage)); @@ -95,7 +104,7 @@ public function testGetUniqueMachineName() { ->method('getQuery') ->will($this->returnValue($query)); - $block_form_controller = new BlockForm($this->entityManager, $this->conditionManager, $this->dispatcher, $this->language); + $block_form_controller = new BlockForm($this->entityManager, $this->conditionManager, $this->dispatcher, $this->language, $this->themeHandler); // Ensure that the block with just one other instance gets the next available // name suggestion.