summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-08-22 22:50:23 (GMT)
committerAlex Pott2014-08-22 22:50:23 (GMT)
commit7fde4cf6e6d408043a178339c5bd31d3c6413782 (patch)
tree3ef5e494945ff71b755d778bd58500f9e01bc119
parentcd65494f7313c1964b681904293f3c5fba55b4f3 (diff)
Issue #2212427 by Mixologic, YesCT, Sutharsan, mgriego, icseh., visabhishek, znerol: Use interface instead of class name for language manager where appropriate.
-rw-r--r--core/lib/Drupal/Core/Controller/ControllerBase.php4
-rw-r--r--core/lib/Drupal/Core/Entity/EntityManagerInterface.php2
-rw-r--r--core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php12
-rw-r--r--core/lib/Drupal/Core/Menu/ContextualLinkManager.php6
-rw-r--r--core/lib/Drupal/Core/Menu/LocalTaskManager.php6
-rw-r--r--core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php8
-rw-r--r--core/lib/Drupal/Core/Path/AliasManager.php3
-rw-r--r--core/lib/Drupal/Core/TypedData/TranslatableInterface.php2
-rw-r--r--core/modules/block_content/src/BlockContentForm.php8
-rw-r--r--core/modules/ckeditor/src/Plugin/Editor/CKEditor.php8
-rw-r--r--core/modules/field/src/Plugin/views/field/Field.php8
-rw-r--r--core/modules/language/tests/language_test/src/Controller/LanguageTestController.php6
-rw-r--r--core/modules/locale/src/Form/TranslateFormBase.php8
-rw-r--r--core/modules/user/src/Form/UserPasswordForm.php8
-rw-r--r--core/modules/user/src/ProfileForm.php4
-rw-r--r--core/modules/user/src/RegisterForm.php4
-rw-r--r--core/modules/views/tests/src/ViewsDataTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Datetime/DateTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php3
-rw-r--r--core/tests/Drupal/Tests/Core/Utility/TokenTest.php6
20 files changed, 53 insertions, 57 deletions
diff --git a/core/lib/Drupal/Core/Controller/ControllerBase.php b/core/lib/Drupal/Core/Controller/ControllerBase.php
index 62fab4a..bec7842 100644
--- a/core/lib/Drupal/Core/Controller/ControllerBase.php
+++ b/core/lib/Drupal/Core/Controller/ControllerBase.php
@@ -57,7 +57,7 @@ abstract class ControllerBase implements ContainerInjectionInterface {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -246,7 +246,7 @@ abstract class ControllerBase implements ContainerInjectionInterface {
/**
* Returns the language manager service.
*
- * @return \Drupal\Core\Language\LanguageManager
+ * @return \Drupal\Core\Language\LanguageManagerInterface
* The language manager.
*/
protected function languageManager() {
diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
index aac79ca..68ed119 100644
--- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
@@ -272,7 +272,7 @@ interface EntityManagerInterface extends PluginManagerInterface {
* @return \Drupal\Core\Entity\EntityInterface
* An entity object for the translated data.
*
- * @see \Drupal\Core\Language\LanguageManager::getFallbackCandidates()
+ * @see \Drupal\Core\Language\LanguageManagerInterface::getFallbackCandidates()
*/
public function getTranslationFromContext(EntityInterface $entity, $langcode = NULL, $context = array());
diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
index eb39600..1dca1ee 100644
--- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
@@ -10,7 +10,7 @@ namespace Drupal\Core\EventSubscriber;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ConfigFactoryInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Request;
@@ -27,9 +27,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class FinishResponseSubscriber implements EventSubscriberInterface {
/**
- * The LanguageManager object for retrieving the correct language code.
+ * The language manager object for retrieving the correct language code.
*
- * @var LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -43,12 +43,12 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
/**
* Constructs a FinishResponseSubscriber object.
*
- * @param LanguageManager $language_manager
- * The LanguageManager object for retrieving the correct language code.
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
+ * The language manager object for retrieving the correct language code.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* A config factory for retrieving required config objects.
*/
- public function __construct(LanguageManager $language_manager, ConfigFactoryInterface $config_factory) {
+ public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) {
$this->languageManager = $language_manager;
$this->config = $config_factory->get('system.performance');
}
diff --git a/core/lib/Drupal/Core/Menu/ContextualLinkManager.php b/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
index cbbf4e4..8c33949 100644
--- a/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
+++ b/core/lib/Drupal/Core/Menu/ContextualLinkManager.php
@@ -12,7 +12,7 @@ use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Controller\ControllerResolverInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
use Drupal\Core\Plugin\Discovery\YamlDiscovery;
@@ -93,7 +93,7 @@ class ContextualLinkManager extends DefaultPluginManager implements ContextualLi
* The module handler.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* The cache backend.
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
@@ -102,7 +102,7 @@ class ContextualLinkManager extends DefaultPluginManager implements ContextualLi
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* The request stack.
*/
- public function __construct(ControllerResolverInterface $controller_resolver, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManager $language_manager, AccessManagerInterface $access_manager, AccountInterface $account, RequestStack $request_stack) {
+ public function __construct(ControllerResolverInterface $controller_resolver, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account, RequestStack $request_stack) {
$this->discovery = new YamlDiscovery('links.contextual', $module_handler->getModuleDirectories());
$this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
$this->factory = new ContainerFactory($this);
diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
index 839ef32..88e504a 100644
--- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
@@ -13,7 +13,7 @@ use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Controller\ControllerResolverInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
use Drupal\Core\Plugin\Discovery\YamlDiscovery;
@@ -120,14 +120,14 @@ class LocalTaskManager extends DefaultPluginManager {
* The module handler.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache
* The cache backend.
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
* The access manager.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user.
*/
- public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteProviderInterface $route_provider, RouteBuilderInterface $route_builder, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManager $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
+ public function __construct(ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteProviderInterface $route_provider, RouteBuilderInterface $route_builder, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
$this->discovery = new YamlDiscovery('links.task', $module_handler->getModuleDirectories());
$this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
$this->factory = new ContainerFactory($this);
diff --git a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
index 93d9b40..19ba99f 100644
--- a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
+++ b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
@@ -8,7 +8,7 @@
namespace Drupal\Core\Page;
use Drupal\Core\Cache\CacheableInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
/**
* Default page rendering engine.
@@ -18,17 +18,17 @@ class DefaultHtmlFragmentRenderer implements HtmlFragmentRendererInterface {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* Constructs a new DefaultHtmlPageRenderer.
*
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager service.
*/
- public function __construct(LanguageManager $language_manager) {
+ public function __construct(LanguageManagerInterface $language_manager) {
$this->languageManager = $language_manager;
}
diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php
index e22ceea..bca2eea 100644
--- a/core/lib/Drupal/Core/Path/AliasManager.php
+++ b/core/lib/Drupal/Core/Path/AliasManager.php
@@ -10,7 +10,6 @@ namespace Drupal\Core\Path;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\CacheDecorator\CacheDecoratorInterface;
use Drupal\Core\Language\LanguageInterface;
-use Drupal\Core\Language\LanguageManager;
use Drupal\Core\Language\LanguageManagerInterface;
class AliasManager implements AliasManagerInterface, CacheDecoratorInterface {
@@ -46,7 +45,7 @@ class AliasManager implements AliasManagerInterface, CacheDecoratorInterface {
/**
* Language manager for retrieving the default langcode when none is specified.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
diff --git a/core/lib/Drupal/Core/TypedData/TranslatableInterface.php b/core/lib/Drupal/Core/TypedData/TranslatableInterface.php
index 999bfb7..4b028ff 100644
--- a/core/lib/Drupal/Core/TypedData/TranslatableInterface.php
+++ b/core/lib/Drupal/Core/TypedData/TranslatableInterface.php
@@ -7,8 +7,6 @@
namespace Drupal\Core\TypedData;
-use Drupal\Core\Language\LanguageManager;
-
/**
* Interface for translatable data.
*/
diff --git a/core/modules/block_content/src/BlockContentForm.php b/core/modules/block_content/src/BlockContentForm.php
index cd2b951..d919da0 100644
--- a/core/modules/block_content/src/BlockContentForm.php
+++ b/core/modules/block_content/src/BlockContentForm.php
@@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
@@ -30,7 +30,7 @@ class BlockContentForm extends ContentEntityForm {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -41,10 +41,10 @@ class BlockContentForm extends ContentEntityForm {
* The entity manager.
* @param \Drupal\Core\Entity\EntityStorageInterface $block_content_storage
* The custom block storage.
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
- public function __construct(EntityManagerInterface $entity_manager, EntityStorageInterface $block_content_storage, LanguageManager $language_manager) {
+ public function __construct(EntityManagerInterface $entity_manager, EntityStorageInterface $block_content_storage, LanguageManagerInterface $language_manager) {
parent::__construct($entity_manager);
$this->blockContentStorage = $block_content_storage;
$this->languageManager = $language_manager;
diff --git a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
index c683627..6d92f98 100644
--- a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
+++ b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
@@ -11,7 +11,7 @@ use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\ckeditor\CKEditorPluginManager;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Render\Element;
use Drupal\editor\Plugin\EditorBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
@@ -41,7 +41,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -65,10 +65,10 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
* The CKEditor plugin manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler to invoke hooks on.
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
- public function __construct(array $configuration, $plugin_id, $plugin_definition, CKEditorPluginManager $ckeditor_plugin_manager, ModuleHandlerInterface $module_handler, LanguageManager $language_manager) {
+ public function __construct(array $configuration, $plugin_id, $plugin_definition, CKEditorPluginManager $ckeditor_plugin_manager, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->ckeditorPluginManager = $ckeditor_plugin_manager;
$this->moduleHandler = $module_handler;
diff --git a/core/modules/field/src/Plugin/views/field/Field.php b/core/modules/field/src/Plugin/views/field/Field.php
index 4705437..ad3a99e 100644
--- a/core/modules/field/src/Plugin/views/field/Field.php
+++ b/core/modules/field/src/Plugin/views/field/Field.php
@@ -18,7 +18,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Field\FormatterPluginManager;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Session\AccountInterface;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -106,7 +106,7 @@ class Field extends FieldPluginBase {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -123,10 +123,10 @@ class Field extends FieldPluginBase {
* The field formatter plugin manager.
* @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager
* The field formatter plugin manager.
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
- public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, FormatterPluginManager $formatter_plugin_manager, LanguageManager $language_manager) {
+ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, FormatterPluginManager $formatter_plugin_manager, LanguageManagerInterface $language_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityManager = $entity_manager;
diff --git a/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php b/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php
index dd6aff8..8095270 100644
--- a/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php
+++ b/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php
@@ -8,7 +8,7 @@
namespace Drupal\language_test\Controller;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
@@ -28,7 +28,7 @@ class LanguageTestController implements ContainerInjectionInterface {
/**
* The language manager service.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -38,7 +38,7 @@ class LanguageTestController implements ContainerInjectionInterface {
* @param \Symfony\Component\HttpKernel\HttpKernelInterface $httpKernel
* An HTTP kernel.
*/
- public function __construct(HttpKernelInterface $httpKernel, LanguageManager $language_manager) {
+ public function __construct(HttpKernelInterface $httpKernel, LanguageManagerInterface $language_manager) {
$this->httpKernel = $httpKernel;
$this->languageManager = $language_manager;
}
diff --git a/core/modules/locale/src/Form/TranslateFormBase.php b/core/modules/locale/src/Form/TranslateFormBase.php
index d86027b..4599c44 100644
--- a/core/modules/locale/src/Form/TranslateFormBase.php
+++ b/core/modules/locale/src/Form/TranslateFormBase.php
@@ -8,7 +8,7 @@
namespace Drupal\locale\Form;
use Drupal\Core\Form\FormBase;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\locale\StringStorageInterface;
use Drupal\Core\State\StateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -37,7 +37,7 @@ abstract class TranslateFormBase extends FormBase {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -55,10 +55,10 @@ abstract class TranslateFormBase extends FormBase {
* The locale storage.
* @param \Drupal\Core\State\StateInterface $state
* The state service.
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
- public function __construct(StringStorageInterface $locale_storage, StateInterface $state, LanguageManager $language_manager) {
+ public function __construct(StringStorageInterface $locale_storage, StateInterface $state, LanguageManagerInterface $language_manager) {
$this->localeStorage = $locale_storage;
$this->state = $state;
$this->languageManager = $language_manager;
diff --git a/core/modules/user/src/Form/UserPasswordForm.php b/core/modules/user/src/Form/UserPasswordForm.php
index bda1a35..c2ed909 100644
--- a/core/modules/user/src/Form/UserPasswordForm.php
+++ b/core/modules/user/src/Form/UserPasswordForm.php
@@ -10,7 +10,7 @@ namespace Drupal\user\Form;
use Drupal\Core\Field\Plugin\Field\FieldType\EmailItem;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\user\UserStorageInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -30,7 +30,7 @@ class UserPasswordForm extends FormBase {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager
+ * @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
@@ -39,10 +39,10 @@ class UserPasswordForm extends FormBase {
*
* @param \Drupal\user\UserStorageInterface $user_storage
* The user storage.
- * @param \Drupal\Core\Language\LanguageManager $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
- public function __construct(UserStorageInterface $user_storage, LanguageManager $language_manager) {
+ public function __construct(UserStorageInterface $user_storage, LanguageManagerInterface $language_manager) {
$this->userStorage = $user_storage;
$this->languageManager = $language_manager;
}
diff --git a/core/modules/user/src/ProfileForm.php b/core/modules/user/src/ProfileForm.php
index 25a5560..998d29b 100644
--- a/core/modules/user/src/ProfileForm.php
+++ b/core/modules/user/src/ProfileForm.php
@@ -10,7 +10,7 @@ namespace Drupal\user;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
/**
* Form controller for the profile forms.
@@ -20,7 +20,7 @@ class ProfileForm extends AccountForm {
/**
* {@inheritdoc}
*/
- public function __construct(EntityManagerInterface $entity_manager, LanguageManager $language_manager, QueryFactory $entity_query) {
+ public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, QueryFactory $entity_query) {
parent::__construct($entity_manager, $language_manager, $entity_query);
}
diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php
index 2a9cb41..09ddc3d 100644
--- a/core/modules/user/src/RegisterForm.php
+++ b/core/modules/user/src/RegisterForm.php
@@ -10,7 +10,7 @@ namespace Drupal\user;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Language\LanguageManager;
+use Drupal\Core\Language\LanguageManagerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
@@ -21,7 +21,7 @@ class RegisterForm extends AccountForm {
/**
* {@inheritdoc}
*/
- public function __construct(EntityManagerInterface $entity_manager, LanguageManager $language_manager, QueryFactory $entity_query) {
+ public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, QueryFactory $entity_query) {
parent::__construct($entity_manager, $language_manager, $entity_query);
}
diff --git a/core/modules/views/tests/src/ViewsDataTest.php b/core/modules/views/tests/src/ViewsDataTest.php
index d06cd06..7f9342c 100644
--- a/core/modules/views/tests/src/ViewsDataTest.php
+++ b/core/modules/views/tests/src/ViewsDataTest.php
@@ -41,7 +41,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* The mocked language manager.
*
- * @var \Drupal\Core\Language\LanguageManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Drupal\Core\Language\LanguageManagerInterface|\PHPUnit_Framework_MockObject_MockObject
*/
protected $languageManager;
diff --git a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
index 74a1559..a2653bb 100644
--- a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
+++ b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
@@ -26,7 +26,7 @@ class DateTest extends UnitTestCase {
/**
* The mocked language manager.
*
- * @var \Drupal\Core\Language\LanguageManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Drupal\Core\Language\LanguageManagerInterface|\PHPUnit_Framework_MockObject_MockObject
*/
protected $languageManager;
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
index a00082c..7c9126c 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
@@ -68,7 +68,7 @@ class EntityManagerTest extends UnitTestCase {
/**
* The language manager.
*
- * @var \Drupal\Core\Language\LanguageManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Drupal\Core\Language\LanguageManagerInterface|\PHPUnit_Framework_MockObject_MockObject
*/
protected $languageManager;
@@ -108,6 +108,7 @@ class EntityManagerTest extends UnitTestCase {
$this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
$this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+
$this->languageManager->expects($this->any())
->method('getCurrentLanguage')
->will($this->returnValue((object) array('id' => 'en')));
diff --git a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
index 6cf2646..3736f0b 100644
--- a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
@@ -27,7 +27,7 @@ class TokenTest extends UnitTestCase {
/**
* The language manager used for testing.
*
- * @var \Drupal\Core\Language\LanguageManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Drupal\Core\Language\LanguageManagerInterface|\PHPUnit_Framework_MockObject_MockObject
*/
protected $languageManager;
@@ -51,9 +51,7 @@ class TokenTest extends UnitTestCase {
protected function setUp() {
$this->cache = $this->getMock('\Drupal\Core\Cache\CacheBackendInterface');
- $this->languageManager = $this->getMockBuilder('\Drupal\Core\Language\LanguageManager')
- ->disableOriginalConstructor()
- ->getMock();
+ $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
$this->moduleHandler = $this->getMock('\Drupal\Core\Extension\ModuleHandlerInterface');