diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 6ee49d5..7f2738f 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -640,8 +640,6 @@ public function createAttribute(array $attributes = []) { * * @param array|object $element * The parent renderable array to exclude the child items. - * @param string[] $args, ... - * The string keys of $element to prevent printing. * * @return array * The filtered renderable array. diff --git a/core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php b/core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php index 984e024..9888caa 100644 --- a/core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php +++ b/core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php @@ -2,12 +2,10 @@ namespace Drupal\twig_extension_test\TwigExtension; -use Drupal\Core\Template\TwigExtension; - /** * A test Twig extension that adds a custom function and a custom filter. */ -class TestExtension extends Twig_Extension { +class TestExtension extends \Twig_Extension { /** * Generates a list of all Twig functions that this extension defines. diff --git a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php index 877acf9..4e790d8 100644 --- a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php +++ b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php @@ -100,7 +100,7 @@ public function testEscaping($template, $expected) { ]); $twig->addExtension($this->systemUnderTest); - $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); + $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), TRUE), FALSE)); $nodes = $twig->parse($twig->tokenize(new \Twig_Source($template, $name))); $this->assertSame($expected, $nodes->getNode('body') @@ -155,7 +155,7 @@ public function testActiveTheme() { ->method('getActiveTheme') ->willReturn($active_theme); - $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); + $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), TRUE), FALSE)); $loader = new \Twig_Loader_Array([$name => '{{ active_theme() }}']); $twig = new \Twig_Environment($loader); $twig->addExtension($this->systemUnderTest); @@ -193,7 +193,7 @@ public function testActiveThemePath() { ->method('getActiveTheme') ->willReturn($active_theme); - $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); + $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), TRUE), FALSE)); $loader = new \Twig_Loader_Array([$name => '{{ active_theme_path() }}']); $twig = new \Twig_Environment($loader); $twig->addExtension($this->systemUnderTest); @@ -355,7 +355,7 @@ public function testRenderVarWithGeneratedLink() { * @covers ::createAttribute */ public function testCreateAttribute() { - $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); + $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), TRUE), FALSE)); $loader = new \Twig_Loader_Array([$name => "{% for iteration in iterations %}{% endfor %}"]); $twig = new \Twig_Environment($loader); $twig->addExtension($this->systemUnderTest); @@ -370,7 +370,7 @@ public function testCreateAttribute() { $this->assertEquals($expected, $result); // Test default creation of empty attribute object and using its method. - $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); + $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), TRUE), FALSE)); $loader = new \Twig_Loader_Array(array($name => "")); $twig->setLoader($loader); $result = $twig->render($name);