diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 75ea035..8988fc8 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -15,9 +15,9 @@ use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Routing\UrlGeneratorInterface; +use Drupal\Core\Theme\ThemeManagerInterface; use Drupal\Core\Url; use Drupal\Core\Utility\LinkGeneratorInterface; -use Drupal\Core\Theme\ThemeManagerInterface; /** * A class providing Drupal Twig extensions. @@ -102,7 +102,7 @@ public function setThemeManager(ThemeManagerInterface $theme_manager) { * {@inheritdoc} */ public function getFunctions() { - return array( + return [ // This function will receive a renderable array, if an array is detected. new \Twig_SimpleFunction('render_var', array($this, 'renderVar')), // The url and path function are defined in close parallel to those found @@ -113,8 +113,8 @@ public function getFunctions() { new \Twig_SimpleFunction('link', array($this, 'getLink')), new \Twig_SimpleFunction('file_url', 'file_create_url'), new \Twig_SimpleFunction('attach_library', array($this, 'attachLibrary')), - new \Twig_SimpleFunction('active_theme', array($this, 'activeTheme')), - ); + new \Twig_SimpleFunction('active_theme', [$this, 'activeTheme']), + ]; } /** diff --git a/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php b/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php index fe5d49f..970741b 100644 --- a/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php +++ b/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php @@ -88,7 +88,7 @@ public function registryLoaderRender() { * Menu callback for testing the active theme function. */ public function activeThemeRender() { - return array('#theme' => 'twig_theme_test_active_theme'); + return ['#theme' => 'twig_theme_test_active_theme']; } } diff --git a/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module b/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module index dda6528..7867531 100644 --- a/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module +++ b/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.module @@ -54,10 +54,10 @@ function twig_theme_test_theme($existing, $type, $theme, $path) { 'variables' => array(), 'template' => 'twig_theme_test.attach_library', ); - $items['twig_theme_test_active_theme'] = array( - 'variables' => array(), + $items['twig_theme_test_active_theme'] = [ + 'variables' => [], 'template' => 'twig_theme_test.active_theme', - ); + ]; return $items; }