1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-15 13:24:10 +02:00

[ticket/13616] Fix CS + constant in the core extension

PHPBB3-13616
This commit is contained in:
Tristan Darricau 2016-04-03 16:14:50 +02:00
parent 6d2acb5ba3
commit 5754cbfec4
3 changed files with 8 additions and 4 deletions

View File

@ -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'])
{

View File

@ -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]);

View File

@ -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]);