Skip to content

Commit e0b23ee

Browse files
committed
Save functions result in a variable
Do this instead of calling it twice
1 parent 1ad1299 commit e0b23ee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

DependencyInjection/HttplugExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public function load(array $configs, ContainerBuilder $container)
5858
}
5959

6060
// Configure toolbar
61-
if ($this->isConfigEnabled($container, $config['profiling'])) {
61+
$profilingEnabled = $this->isConfigEnabled($container, $config['profiling']);
62+
if ($profilingEnabled) {
6263
$loader->load('data-collector.xml');
6364

6465
if (!empty($config['profiling']['formatter'])) {
@@ -75,7 +76,7 @@ public function load(array $configs, ContainerBuilder $container)
7576
;
7677
}
7778

78-
$this->configureClients($container, $config, $this->isConfigEnabled($container, $config['profiling']));
79+
$this->configureClients($container, $config, $profilingEnabled);
7980
$this->configureSharedPlugins($container, $config['plugins']); // must be after clients, as clients.X.plugins might use plugins as templates that will be removed
8081
$this->configureAutoDiscoveryClients($container, $config);
8182
}

0 commit comments

Comments
 (0)