Skip to content

Commit 7624b2a

Browse files
committed
Merge branch '4.2' into short-array-master
* 4.2: fixed CS fixed CS fixed tests fixed CS fixed CS fixed CS fixed short array CS in comments fixed CS in ExpressionLanguage fixtures fixed CS in generated files fixed CS on generated container files fixed CS on Form PHP templates fixed CS on YAML fixtures fixed fixtures switched array() to []
2 parents 5cf5a8a + 4d968e3 commit 7624b2a

File tree

177 files changed

+1968
-1968
lines changed

Some content is hidden

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

177 files changed

+1968
-1968
lines changed

Argument/BoundArgument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct($value, bool $trackUsage = true)
3737
*/
3838
public function getValues()
3939
{
40-
return array($this->value, $this->identifier, $this->used);
40+
return [$this->value, $this->identifier, $this->used];
4141
}
4242

4343
/**

Argument/ServiceClosureArgument.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ServiceClosureArgument implements ArgumentInterface
2525

2626
public function __construct(Reference $reference)
2727
{
28-
$this->values = array($reference);
28+
$this->values = [$reference];
2929
}
3030

3131
/**
@@ -41,7 +41,7 @@ public function getValues()
4141
*/
4242
public function setValues(array $values)
4343
{
44-
if (array(0) !== array_keys($values) || !($values[0] instanceof Reference || null === $values[0])) {
44+
if ([0] !== array_keys($values) || !($values[0] instanceof Reference || null === $values[0])) {
4545
throw new InvalidArgumentException('A ServiceClosureArgument must hold one and only one Reference.');
4646
}
4747

Argument/TaggedIteratorArgument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TaggedIteratorArgument extends IteratorArgument
2222

2323
public function __construct(string $tag)
2424
{
25-
parent::__construct(array());
25+
parent::__construct([]);
2626

2727
$this->tag = $tag;
2828
}

Compiler/AbstractRecursivePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function processValue($value, $isRoot = false)
8686
} elseif ($value instanceof ArgumentInterface) {
8787
$value->setValues($this->processValue($value->getValues()));
8888
} elseif ($value instanceof Expression && $this->processExpressions) {
89-
$this->getExpressionLanguage()->compile((string) $value, array('this' => 'container'));
89+
$this->getExpressionLanguage()->compile((string) $value, ['this' => 'container']);
9090
} elseif ($value instanceof Definition) {
9191
$value->setArguments($this->processValue($value->getArguments()));
9292
$value->setProperties($this->processValue($value->getProperties()));

Compiler/AnalyzeServiceReferencesPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function process(ContainerBuilder $container)
7878
try {
7979
parent::process($container);
8080
} finally {
81-
$this->aliases = $this->definitions = array();
81+
$this->aliases = $this->definitions = [];
8282
}
8383
}
8484

Compiler/AutowirePass.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private function doProcessValue($value, $isRoot = false)
116116
}
117117

118118
if ($constructor) {
119-
array_unshift($this->methodCalls, array($constructor, $value->getArguments()));
119+
array_unshift($this->methodCalls, [$constructor, $value->getArguments()]);
120120
}
121121

122122
$this->methodCalls = $this->autowireCalls($reflectionClass, $isRoot);
@@ -307,8 +307,8 @@ private function getAutowiredReference(TypedReference $reference)
307307
*/
308308
private function populateAvailableTypes(ContainerBuilder $container)
309309
{
310-
$this->types = array();
311-
$this->ambiguousServiceTypes = array();
310+
$this->types = [];
311+
$this->ambiguousServiceTypes = [];
312312

313313
foreach ($container->getDefinitions() as $id => $definition) {
314314
$this->populateAvailableType($container, $id, $definition);
@@ -359,7 +359,7 @@ private function set(string $type, string $id)
359359

360360
// keep an array of all services matching this type
361361
if (!isset($this->ambiguousServiceTypes[$type])) {
362-
$this->ambiguousServiceTypes[$type] = array($this->types[$type]);
362+
$this->ambiguousServiceTypes[$type] = [$this->types[$type]];
363363
unset($this->types[$type]);
364364
}
365365
$this->ambiguousServiceTypes[$type][] = $id;
@@ -437,7 +437,7 @@ private function createTypeAlternatives(ContainerBuilder $container, TypedRefere
437437

438438
private function getAliasesSuggestionForType(ContainerBuilder $container, $type, $extraContext = null)
439439
{
440-
$aliases = array();
440+
$aliases = [];
441441
foreach (class_parents($type) + class_implements($type) as $parent) {
442442
if ($container->has($parent) && !$container->findDefinition($parent)->isAbstract()) {
443443
$aliases[] = $parent;

Compiler/AutowireRequiredMethodsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function processValue($value, $isRoot = false)
3434
return $value;
3535
}
3636

37-
$alreadyCalledMethods = array();
37+
$alreadyCalledMethods = [];
3838

3939
foreach ($value->getMethodCalls() as list($method)) {
4040
$alreadyCalledMethods[strtolower($method)] = true;

Compiler/CheckCircularReferencesPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public function process(ContainerBuilder $container)
3636
{
3737
$graph = $container->getCompiler()->getServiceReferenceGraph();
3838

39-
$this->checkedNodes = array();
39+
$this->checkedNodes = [];
4040
foreach ($graph->getNodes() as $id => $node) {
41-
$this->currentPath = array($id);
41+
$this->currentPath = [$id];
4242

4343
$this->checkOutEdges($node->getOutEdges());
4444
}

Compiler/CheckDefinitionValidityPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function process(ContainerBuilder $container)
8383
if ($definition->isPublic() && !$definition->isPrivate()) {
8484
$resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs);
8585
if (null !== $usedEnvs) {
86-
throw new EnvParameterException(array($resolvedId), null, 'A service name ("%s") cannot contain dynamic values.');
86+
throw new EnvParameterException([$resolvedId], null, 'A service name ("%s") cannot contain dynamic values.');
8787
}
8888
}
8989
}
@@ -92,7 +92,7 @@ public function process(ContainerBuilder $container)
9292
if ($alias->isPublic() && !$alias->isPrivate()) {
9393
$resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs);
9494
if (null !== $usedEnvs) {
95-
throw new EnvParameterException(array($resolvedId), null, 'An alias name ("%s") cannot contain dynamic values.');
95+
throw new EnvParameterException([$resolvedId], null, 'An alias name ("%s") cannot contain dynamic values.');
9696
}
9797
}
9898
}

Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
*/
2424
class CheckExceptionOnInvalidReferenceBehaviorPass extends AbstractRecursivePass
2525
{
26-
private $serviceLocatorContextIds = array();
26+
private $serviceLocatorContextIds = [];
2727

2828
/**
2929
* {@inheritdoc}
3030
*/
3131
public function process(ContainerBuilder $container)
3232
{
33-
$this->serviceLocatorContextIds = array();
33+
$this->serviceLocatorContextIds = [];
3434
foreach ($container->findTaggedServiceIds('container.service_locator_context') as $id => $tags) {
3535
$this->serviceLocatorContextIds[$id] = $tags[0]['id'];
3636
$container->getDefinition($id)->clearTag('container.service_locator_context');
@@ -39,7 +39,7 @@ public function process(ContainerBuilder $container)
3939
try {
4040
return parent::process($container);
4141
} finally {
42-
$this->serviceLocatorContextIds = array();
42+
$this->serviceLocatorContextIds = [];
4343
}
4444
}
4545

0 commit comments

Comments
 (0)