Skip to content

Commit 6debc47

Browse files
Merge branch '2.8' into 3.4
* 2.8: 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 638f5ad + ad69931 commit 6debc47

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
@@ -49,7 +49,7 @@ public function __construct(OptionsResolver $optionsResolver)
4949
*/
5050
public function getDefault($option)
5151
{
52-
return call_user_func($this->get, 'defaults', $option, sprintf('No default value was set for the "%s" option.', $option));
52+
return \call_user_func($this->get, 'defaults', $option, sprintf('No default value was set for the "%s" option.', $option));
5353
}
5454

5555
/**
@@ -61,7 +61,7 @@ public function getDefault($option)
6161
*/
6262
public function getLazyClosures($option)
6363
{
64-
return call_user_func($this->get, 'lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option));
64+
return \call_user_func($this->get, 'lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option));
6565
}
6666

6767
/**
@@ -73,7 +73,7 @@ public function getLazyClosures($option)
7373
*/
7474
public function getAllowedTypes($option)
7575
{
76-
return call_user_func($this->get, 'allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option));
76+
return \call_user_func($this->get, 'allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option));
7777
}
7878

7979
/**
@@ -85,7 +85,7 @@ public function getAllowedTypes($option)
8585
*/
8686
public function getAllowedValues($option)
8787
{
88-
return call_user_func($this->get, 'allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option));
88+
return \call_user_func($this->get, 'allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option));
8989
}
9090

9191
/**
@@ -97,6 +97,6 @@ public function getAllowedValues($option)
9797
*/
9898
public function getNormalizer($option)
9999
{
100-
return call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
100+
return \call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
101101
}
102102
}

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)
@@ -988,7 +988,7 @@ public function count()
988988
throw new AccessException('Counting is only supported within closures of lazy options and normalizers.');
989989
}
990990

991-
return count($this->defaults);
991+
return \count($this->defaults);
992992
}
993993

994994
/**
@@ -1030,7 +1030,7 @@ private function formatTypeOf($value, $type)
10301030
}
10311031
}
10321032

1033-
return (\is_object($value) ? get_class($value) : gettype($value)).$suffix;
1033+
return (\is_object($value) ? \get_class($value) : \gettype($value)).$suffix;
10341034
}
10351035

10361036
/**
@@ -1047,7 +1047,7 @@ private function formatTypeOf($value, $type)
10471047
private function formatValue($value)
10481048
{
10491049
if (\is_object($value)) {
1050-
return get_class($value);
1050+
return \get_class($value);
10511051
}
10521052

10531053
if (\is_array($value)) {
@@ -1100,7 +1100,7 @@ private function formatValues(array $values)
11001100

11011101
private static function isValueValidType($type, $value)
11021102
{
1103-
return (function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
1103+
return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
11041104
}
11051105

11061106
/**

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)