Skip to content

Commit 226d566

Browse files
committed
Optimize perf by replacing call_user_func with dynamic vars
1 parent 31e5523 commit 226d566

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Debug/OptionsResolverIntrospector.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(OptionsResolver $optionsResolver)
4747
*/
4848
public function getDefault(string $option)
4949
{
50-
return \call_user_func($this->get, 'defaults', $option, sprintf('No default value was set for the "%s" option.', $option));
50+
return ($this->get)('defaults', $option, sprintf('No default value was set for the "%s" option.', $option));
5151
}
5252

5353
/**
@@ -57,7 +57,7 @@ public function getDefault(string $option)
5757
*/
5858
public function getLazyClosures(string $option): array
5959
{
60-
return \call_user_func($this->get, 'lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option));
60+
return ($this->get)('lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option));
6161
}
6262

6363
/**
@@ -67,7 +67,7 @@ public function getLazyClosures(string $option): array
6767
*/
6868
public function getAllowedTypes(string $option): array
6969
{
70-
return \call_user_func($this->get, 'allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option));
70+
return ($this->get)('allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option));
7171
}
7272

7373
/**
@@ -77,14 +77,14 @@ public function getAllowedTypes(string $option): array
7777
*/
7878
public function getAllowedValues(string $option): array
7979
{
80-
return \call_user_func($this->get, 'allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option));
80+
return ($this->get)('allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option));
8181
}
8282

8383
/**
8484
* @throws NoConfigurationException on no configured normalizer
8585
*/
8686
public function getNormalizer(string $option): \Closure
8787
{
88-
return \call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
88+
return ($this->get)('normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
8989
}
9090
}

0 commit comments

Comments
 (0)