diff --git a/core/lib/Drupal/Core/Render/Element.php b/core/lib/Drupal/Core/Render/Element.php index 83a8f97..9a3241f 100644 --- a/core/lib/Drupal/Core/Render/Element.php +++ b/core/lib/Drupal/Core/Render/Element.php @@ -7,6 +7,8 @@ namespace Drupal\Core\Render; +use Drupal\Component\Utility\String; + /** * Deals with drupal render elements. */ @@ -84,7 +86,7 @@ public static function children(array &$elements, $sort = FALSE) { // Only trigger an error if the value is not null. // @see http://drupal.org/node/1283892 elseif (isset($value)) { - trigger_error(t('"@key" is an invalid render array key', array('@key' => $key)), E_USER_ERROR); + trigger_error(String::format('"@key" is an invalid render array key', array('@key' => $key)), E_USER_ERROR); } } } diff --git a/core/tests/Drupal/Tests/Core/Render/ElementTest.php b/core/tests/Drupal/Tests/Core/Render/ElementTest.php index 2f55339..7d6e1bc 100644 --- a/core/tests/Drupal/Tests/Core/Render/ElementTest.php +++ b/core/tests/Drupal/Tests/Core/Render/ElementTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\Tests\Core\Render\ElementTest. */ -namespace Drupal\Tests\Core\Render { +namespace Drupal\Tests\Core\Render; use Drupal\Tests\UnitTestCase; use Drupal\Core\Render\Element; @@ -157,13 +157,3 @@ public function providerTestSetAttributes() { } } - -} - -namespace { - if (!function_exists('t')) { - function t($string) { - return $string; - } - } -}