From 8092dc6838fca79773d9489185f704a15e15a348 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 11 Sep 2017 11:14:25 -0700 Subject: [PATCH 1/2] removed the profiler.matcher configuration --- .../DependencyInjection/Configuration.php | 17 --------------- .../FrameworkExtension.php | 21 ------------------- .../Resources/config/profiling.xml | 2 +- .../DependencyInjection/ConfigurationTest.php | 4 ---- 4 files changed, 1 insertion(+), 43 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 55583eba06c32..e31802ac84c04 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -185,23 +185,6 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode) ->booleanNode('only_exceptions')->defaultFalse()->end() ->booleanNode('only_master_requests')->defaultFalse()->end() ->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end() - ->arrayNode('matcher') - ->setDeprecated('The "profiler.matcher" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0.') - ->canBeEnabled() - ->performNoDeepMerging() - ->fixXmlConfig('ip') - ->children() - ->scalarNode('path') - ->info('use the urldecoded format') - ->example('^/path to resource/') - ->end() - ->scalarNode('service')->end() - ->arrayNode('ips') - ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end() - ->prototype('scalar')->end() - ->end() - ->end() - ->end() ->end() ->end() ->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 9593564b6c7c2..5d047cc02ce98 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -445,27 +445,6 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $ $container->setParameter('profiler.storage.dsn', $config['dsn']); - if ($this->isConfigEnabled($container, $config['matcher'])) { - if (isset($config['matcher']['service'])) { - $container->setAlias('profiler.request_matcher', $config['matcher']['service'])->setPrivate(true); - } elseif (isset($config['matcher']['ip']) || isset($config['matcher']['path']) || isset($config['matcher']['ips'])) { - $definition = $container->register('profiler.request_matcher', 'Symfony\\Component\\HttpFoundation\\RequestMatcher'); - $definition->setPublic(false); - - if (isset($config['matcher']['ip'])) { - $definition->addMethodCall('matchIp', array($config['matcher']['ip'])); - } - - if (isset($config['matcher']['ips'])) { - $definition->addMethodCall('matchIps', array($config['matcher']['ips'])); - } - - if (isset($config['matcher']['path'])) { - $definition->addMethodCall('matchPath', array($config['matcher']['path'])); - } - } - } - if (!$config['collect']) { $container->getDefinition('profiler')->addMethodCall('disable', array()); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml index 635dc8d2b3ed0..8816284fa78ed 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml @@ -21,7 +21,7 @@ - + null %profiler_listener.only_exceptions% %profiler_listener.only_master_requests% diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index c53f6544ed8ab..eb28c69527160 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -148,10 +148,6 @@ protected static function getBundleDefaultConfig() 'only_master_requests' => false, 'dsn' => 'file:%kernel.cache_dir%/profiler', 'collect' => true, - 'matcher' => array( - 'enabled' => false, - 'ips' => array(), - ), ), 'translator' => array( 'enabled' => !class_exists(FullStack::class), From 5b77d991e98e0d4d8ad3567529ffc68fc2393207 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 14 Sep 2017 20:37:43 -0700 Subject: [PATCH 2/2] fixed CS --- .../DependencyInjection/FrameworkExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 5d047cc02ce98..8120561255cd5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -480,9 +480,9 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $ $transitions = array(); foreach ($workflow['transitions'] as $transition) { - if ($type === 'workflow') { + if ('workflow' === $type) { $transitions[] = new Definition(Workflow\Transition::class, array($transition['name'], $transition['from'], $transition['to'])); - } elseif ($type === 'state_machine') { + } elseif ('state_machine' === $type) { foreach ($transition['from'] as $from) { foreach ($transition['to'] as $to) { $transitions[] = new Definition(Workflow\Transition::class, array($transition['name'], $from, $to));