diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-04-03 16:14:50 +0200 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-04-03 16:23:16 +0200 |
commit | 5754cbfec445919dd8b7f261de33d75cbdc78fdd (patch) | |
tree | 05d7a229fcdd291f82750e6797178d1516098883 | |
parent | 6d2acb5ba3fbd22b345b312e704021eab1375941 (diff) | |
download | forums-5754cbfec445919dd8b7f261de33d75cbdc78fdd.tar forums-5754cbfec445919dd8b7f261de33d75cbdc78fdd.tar.gz forums-5754cbfec445919dd8b7f261de33d75cbdc78fdd.tar.bz2 forums-5754cbfec445919dd8b7f261de33d75cbdc78fdd.tar.xz forums-5754cbfec445919dd8b7f261de33d75cbdc78fdd.zip |
[ticket/13616] Fix CS + constant in the core extension
PHPBB3-13616
-rw-r--r-- | phpBB/phpbb/di/extension/core.php | 6 | ||||
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 3 | ||||
-rw-r--r-- | tests/test_framework/phpbb_ui_test_case.php | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php index 2faeff3636..29c0b0e44e 100644 --- a/phpBB/phpbb/di/extension/core.php +++ b/phpBB/phpbb/di/extension/core.php @@ -24,6 +24,8 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class core extends Extension { + const TWIG_OPTIONS_POSITION = 6; + /** * Config path * @var string @@ -71,7 +73,7 @@ class core extends Extension // Set the Twig options if defined in the environment $definition = $container->getDefinition('template.twig.environment'); - $twig_environment_options = $definition->getArgument(6); + $twig_environment_options = $definition->getArgument(static::TWIG_OPTIONS_POSITION); if ($config['twig']['debug']) { $twig_environment_options['debug'] = true; @@ -82,7 +84,7 @@ class core extends Extension } // Replace the 7th argument, the options passed to the environment - $definition->replaceArgument(6, $twig_environment_options); + $definition->replaceArgument(static::TWIG_OPTIONS_POSITION, $twig_environment_options); if ($config['twig']['enable_debug_extension']) { diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 829f64b780..20b89aba4e 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -389,7 +389,8 @@ class phpbb_functional_test_case extends phpbb_test_case $blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader']; - foreach (array_keys($GLOBALS) as $key) { + foreach (array_keys($GLOBALS) as $key) + { if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true)) { unset($GLOBALS[$key]); diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php index e79c78db29..c8ca2a9003 100644 --- a/tests/test_framework/phpbb_ui_test_case.php +++ b/tests/test_framework/phpbb_ui_test_case.php @@ -261,7 +261,8 @@ class phpbb_ui_test_case extends phpbb_test_case $blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader']; - foreach (array_keys($GLOBALS) as $key) { + foreach (array_keys($GLOBALS) as $key) + { if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true)) { unset($GLOBALS[$key]); |