Skip to content

Commit 1913f19

Browse files
Merge branch '4.0' into 4.1
* 4.0: Fix Clidumper tests Enable the fixer enforcing fully-qualified calls for compiler-optimized functions Apply fixers Disable the native_constant_invocation fixer until it can be scoped Update the list of excluded files for the CS fixer
2 parents 0aec9f9 + 5391d9d commit 1913f19

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
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 \call_user_func($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 \call_user_func($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 \call_user_func($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 \call_user_func($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 \call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
8989
}
9090
}

OptionsResolver.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public function addAllowedValues($option, $allowedValues)
478478
));
479479
}
480480

481-
if (!is_array($allowedValues)) {
481+
if (!\is_array($allowedValues)) {
482482
$allowedValues = array($allowedValues);
483483
}
484484

@@ -660,12 +660,12 @@ public function resolve(array $options = array())
660660
// Make sure that no unknown options are passed
661661
$diff = array_diff_key($options, $clone->defined);
662662

663-
if (count($diff) > 0) {
663+
if (\count($diff) > 0) {
664664
ksort($clone->defined);
665665
ksort($diff);
666666

667667
throw new UndefinedOptionsException(sprintf(
668-
(count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".',
668+
(\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".',
669669
implode('", "', array_keys($diff)),
670670
implode('", "', array_keys($clone->defined))
671671
));
@@ -680,11 +680,11 @@ public function resolve(array $options = array())
680680
// Check whether any required option is missing
681681
$diff = array_diff_key($clone->required, $clone->defaults);
682682

683-
if (count($diff) > 0) {
683+
if (\count($diff) > 0) {
684684
ksort($diff);
685685

686686
throw new MissingOptionsException(sprintf(
687-
count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.',
687+
\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.',
688688
implode('", "', array_keys($diff))
689689
));
690690
}
@@ -824,7 +824,7 @@ public function offsetGet($option)
824824
$this->formatValue($value)
825825
);
826826

827-
if (count($printableAllowedValues) > 0) {
827+
if (\count($printableAllowedValues) > 0) {
828828
$message .= sprintf(
829829
' Accepted values are: %s.',
830830
$this->formatValues($printableAllowedValues)
@@ -978,7 +978,7 @@ public function count()
978978
throw new AccessException('Counting is only supported within closures of lazy options and normalizers.');
979979
}
980980

981-
return count($this->defaults);
981+
return \count($this->defaults);
982982
}
983983

984984
/**
@@ -1017,7 +1017,7 @@ private function formatTypeOf($value, ?string $type): string
10171017
}
10181018
}
10191019

1020-
return (\is_object($value) ? get_class($value) : gettype($value)).$suffix;
1020+
return (\is_object($value) ? \get_class($value) : \gettype($value)).$suffix;
10211021
}
10221022

10231023
/**
@@ -1032,7 +1032,7 @@ private function formatTypeOf($value, ?string $type): string
10321032
private function formatValue($value): string
10331033
{
10341034
if (\is_object($value)) {
1035-
return get_class($value);
1035+
return \get_class($value);
10361036
}
10371037

10381038
if (\is_array($value)) {
@@ -1081,7 +1081,7 @@ private function formatValues(array $values): string
10811081

10821082
private static function isValueValidType(string $type, $value): bool
10831083
{
1084-
return (function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
1084+
return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
10851085
}
10861086

10871087
private function getInvalidValues(array $arrayValues, string $type): array

Tests/OptionsResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ public function testCountFailsOutsideResolve()
15841584
$this->resolver->setDefined('bar');
15851585
$this->resolver->setDefault('lazy1', function () {});
15861586

1587-
count($this->resolver);
1587+
\count($this->resolver);
15881588
}
15891589

15901590
public function testNestedArrays()

0 commit comments

Comments
 (0)