diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php index 72360cedd7..a6c1082596 100644 --- a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php @@ -2,6 +2,8 @@ namespace Drupal\Core\StringTranslation; +@trigger_error('The ' . __NAMESPACE__ . '\TranslationWrapper is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the \Drupal\Core\StringTranslation\TranslatableMarkup class instead. See https://www.drupal.org/node/2571255', E_USER_DEPRECATED); + /** * Provides translatable string class. * @@ -10,14 +12,4 @@ * * @see https://www.drupal.org/node/2571255 */ -class TranslationWrapper extends TranslatableMarkup { - - /** - * {@inheritdoc} - */ - public function __construct($string, array $arguments = [], array $options = [], TranslationInterface $string_translation = NULL) { - @trigger_error(__CLASS__ . ' is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the \Drupal\Core\StringTranslation\TranslatableMarkup class instead. See https://www.drupal.org/node/2571255', E_USER_DEPRECATED); - parent::__construct($string, $arguments, $options, $string_translation); - } - -} +class TranslationWrapper extends TranslatableMarkup {} diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php index c3b7bcfe99..8b8355be58 100644 --- a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php +++ b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php @@ -17,7 +17,7 @@ class TranslationWrapperTest extends UnitTestCase { /** * @covers ::__construct * @group legacy - * @expectedDeprecation Drupal\Core\StringTranslation\TranslationWrapper is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the \Drupal\Core\StringTranslation\TranslatableMarkup class instead. See https://www.drupal.org/node/2571255 + * @expectedDeprecation The Drupal\Core\StringTranslation\TranslationWrapper is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the \Drupal\Core\StringTranslation\TranslatableMarkup class instead. See https://www.drupal.org/node/2571255 */ public function testTranslationWrapper() { $object = new TranslationWrapper('Deprecated');