Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 358a4cc

Browse files
committed
minor #19155 [FrameworkBundle] Remove redundant code (Ener-Getick)
This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] Remove redundant code | Q | A | ------------- | --- | Branch? | "master" | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Was part of #17706. Change the remaining ``isset($config['foo'])`` to ``$this->isConfigEnabled($config['foo'])`` to allow to use parameters to enable a feature. Commits ------- a21af88 [FrameworkBundle] Remove redundant code
2 parents 6e03a42 + a21af88 commit 358a4cc

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ public function load(array $configs, ContainerBuilder $container)
140140
$this->registerAnnotationsConfiguration($config['annotations'], $container, $loader);
141141
$this->registerPropertyAccessConfiguration($config['property_access'], $container);
142142

143-
if (isset($config['serializer'])) {
143+
if ($this->isConfigEnabled($container, $config['serializer'])) {
144144
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
145145
}
146146

147-
if (isset($config['property_info'])) {
147+
if ($this->isConfigEnabled($container, $config['property_info'])) {
148148
$this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader);
149149
}
150150

@@ -956,10 +956,6 @@ private function registerSecurityCsrfConfiguration(array $config, ContainerBuild
956956
*/
957957
private function registerSerializerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
958958
{
959-
if (!$this->isConfigEnabled($container, $config)) {
960-
return;
961-
}
962-
963959
if (class_exists('Symfony\Component\Serializer\Normalizer\DataUriNormalizer')) {
964960
// Run after serializer.normalizer.object
965961
$definition = $container->register('serializer.normalizer.data_uri', DataUriNormalizer::class);
@@ -1075,10 +1071,6 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
10751071
*/
10761072
private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
10771073
{
1078-
if (!$this->isConfigEnabled($container, $config)) {
1079-
return;
1080-
}
1081-
10821074
$loader->load('property_info.xml');
10831075

10841076
if (interface_exists('phpDocumentor\Reflection\DocBlockFactoryInterface')) {

0 commit comments

Comments
 (0)