Skip to content

Commit 9c9cbb2

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 62912ab + b19d12b commit 9c9cbb2

File tree

57 files changed

+238
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+238
-238
lines changed

Alias.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(string $id, bool $public = true)
2121
{
2222
$this->id = $id;
2323
$this->public = $public;
24-
$this->private = 2 > func_num_args();
24+
$this->private = 2 > \func_num_args();
2525
}
2626

2727
/**

Argument/IteratorArgument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function setValues(array $values)
4646
{
4747
foreach ($values as $k => $v) {
4848
if (null !== $v && !$v instanceof Reference) {
49-
throw new InvalidArgumentException(sprintf('An IteratorArgument must hold only Reference instances, "%s" given.', is_object($v) ? get_class($v) : gettype($v)));
49+
throw new InvalidArgumentException(sprintf('An IteratorArgument must hold only Reference instances, "%s" given.', \is_object($v) ? \get_class($v) : \gettype($v)));
5050
}
5151
}
5252

Argument/RewindableGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getIterator()
3838

3939
public function count()
4040
{
41-
if (is_callable($count = $this->count)) {
41+
if (\is_callable($count = $this->count)) {
4242
$this->count = $count();
4343
}
4444

ChildDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getArgument($index)
9595
*/
9696
public function replaceArgument($index, $value)
9797
{
98-
if (is_int($index)) {
98+
if (\is_int($index)) {
9999
$this->arguments['index_'.$index] = $value;
100100
} elseif (0 === strpos($index, '$')) {
101101
$this->arguments[$index] = $value;

Compiler/AbstractRecursivePass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ protected function processValue($value, $isRoot = false)
9090
*/
9191
protected function getConstructor(Definition $definition, $required)
9292
{
93-
if (is_string($factory = $definition->getFactory())) {
94-
if (!function_exists($factory)) {
93+
if (\is_string($factory = $definition->getFactory())) {
94+
if (!\function_exists($factory)) {
9595
throw new RuntimeException(sprintf('Invalid service "%s": function "%s" does not exist.', $this->currentId, $factory));
9696
}
9797
$r = new \ReflectionFunction($factory);

Compiler/AutowirePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ private function getAliasesSuggestionForType($type, $extraContext = null)
416416
}
417417

418418
$extraContext = $extraContext ? ' '.$extraContext : '';
419-
if (1 < $len = count($aliases)) {
419+
if (1 < $len = \count($aliases)) {
420420
$message = sprintf('Try changing the type-hint%s to one of its parents: ', $extraContext);
421421
for ($i = 0, --$len; $i < $len; ++$i) {
422422
$message .= sprintf('%s "%s", ', class_exists($aliases[$i], false) ? 'class' : 'interface', $aliases[$i]);

Compiler/CheckArgumentsValidityPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function processValue($value, $isRoot = false)
4141
$i = 0;
4242
foreach ($value->getArguments() as $k => $v) {
4343
if ($k !== $i++) {
44-
if (!is_int($k)) {
44+
if (!\is_int($k)) {
4545
$msg = sprintf('Invalid constructor argument for service "%s": integer expected but found string "%s". Check your service definition.', $this->currentId, $k);
4646
$value->addError($msg);
4747
if ($this->throwExceptions) {
@@ -63,7 +63,7 @@ protected function processValue($value, $isRoot = false)
6363
$i = 0;
6464
foreach ($methodCall[1] as $k => $v) {
6565
if ($k !== $i++) {
66-
if (!is_int($k)) {
66+
if (!\is_int($k)) {
6767
$msg = sprintf('Invalid argument for method call "%s" of service "%s": integer expected but found string "%s". Check your service definition.', $methodCall[0], $this->currentId, $k);
6868
$value->addError($msg);
6969
if ($this->throwExceptions) {

Compiler/CheckCircularReferencesPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function checkOutEdges(array $edges)
6464
$this->currentPath[] = $id;
6565

6666
if (false !== $searchKey) {
67-
throw new ServiceCircularReferenceException($id, array_slice($this->currentPath, $searchKey));
67+
throw new ServiceCircularReferenceException($id, \array_slice($this->currentPath, $searchKey));
6868
}
6969

7070
$this->checkOutEdges($node->getOutEdges());

Compiler/Compiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BE
6969
public function log(CompilerPassInterface $pass, string $message)
7070
{
7171
if (false !== strpos($message, "\n")) {
72-
$message = str_replace("\n", "\n".get_class($pass).': ', trim($message));
72+
$message = str_replace("\n", "\n".\get_class($pass).': ', trim($message));
7373
}
7474

75-
$this->log[] = get_class($pass).': '.$message;
75+
$this->log[] = \get_class($pass).': '.$message;
7676
}
7777

7878
/**

Compiler/InlineServiceDefinitionsPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function processValue($value, $isRoot = false)
7070
$ids = array_keys($this->cloningIds);
7171
$ids[] = $id;
7272

73-
throw new ServiceCircularReferenceException($id, array_slice($ids, array_search($id, $ids)));
73+
throw new ServiceCircularReferenceException($id, \array_slice($ids, array_search($id, $ids)));
7474
}
7575

7676
$this->cloningIds[$id] = true;
@@ -122,11 +122,11 @@ private function isInlineableDefinition($id, Definition $definition, ServiceRefe
122122
$ids[] = $edge->getSourceNode()->getId();
123123
}
124124

125-
if (count(array_unique($ids)) > 1) {
125+
if (\count(array_unique($ids)) > 1) {
126126
return false;
127127
}
128128

129-
if (count($ids) > 1 && is_array($factory = $definition->getFactory()) && ($factory[0] instanceof Reference || $factory[0] instanceof Definition)) {
129+
if (\count($ids) > 1 && \is_array($factory = $definition->getFactory()) && ($factory[0] instanceof Reference || $factory[0] instanceof Definition)) {
130130
return false;
131131
}
132132

0 commit comments

Comments
 (0)