diff --git a/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php b/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php index 686e60e..37cefe6 100644 --- a/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php +++ b/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php @@ -7,7 +7,6 @@ namespace Drupal\locale\Form; -use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Drupal\Component\Utility\String; use Drupal\locale\SourceString; @@ -15,22 +14,6 @@ * Defines a translation edit form. */ class TranslateEditForm extends TranslateFormBase { - - /** - * The state store. - * - * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface - */ - protected $state; - - /** - * Constructs a new TranslateEditForm object. - */ - public function __construct() { - parent::__construct(); - $this->state = $this->container->get('keyvalue')->get('state'); - } - /** * {@inheritdoc} */ diff --git a/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php b/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php index 03b25b2..fcf3725 100644 --- a/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php +++ b/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php @@ -9,6 +9,7 @@ use Drupal\Core\Form\FormBase; use Drupal\locale\StringStorageInterface; +use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -26,11 +27,11 @@ protected $localeStorage; /** - * The service container. + * The state store. * - * @var \Symfony\Component\DependencyInjection\ContainerInterface + * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface */ - protected $container; + protected $state; /* * Filter values. Shared between objects that inherite this class. @@ -44,25 +45,18 @@ * * The translation manager service. */ - public function __construct(ContainerInterface $container) { - $this->container = $container; - $this->localeStorage = $this->container->get('locale.storage'); + public function __construct(StringStorageInterface $locale_storage, KeyValueStore $state) { + $this->localeStorage = $locale_storage; + $this->state = $state; } /** - * Instantiates a new instance of this form. - * - * This is a factory method that returns a new instance of this object. The - * factory should pass any needed dependencies into the constructor of this - * object, but not the container itself. Every call to this method must retur - * a new instance of this object; that is, it may not implement a singleton. - * - * @param \Symfony\Component\DependencyInjection\ContainerInterface $containe - * The service container this object should use. + * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( - $container + $container->get('locale.storage'), + $container->get('keyvalue')->get('state'); ); }