Skip to content

Commit b030f98

Browse files
committed
Merge branch '4.1' into 4.2
* 4.1: 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 ae3a789 + 7aa47f7 commit b030f98

File tree

114 files changed

+1252
-1252
lines changed

Some content is hidden

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

114 files changed

+1252
-1252
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/AutowirePass.php

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

119119
if ($constructor) {
120-
array_unshift($this->methodCalls, array($constructor, $value->getArguments()));
120+
array_unshift($this->methodCalls, [$constructor, $value->getArguments()]);
121121
}
122122

123123
$this->methodCalls = $this->autowireCalls($reflectionClass, $isRoot);
@@ -309,8 +309,8 @@ private function getAutowiredReference(TypedReference $reference)
309309
*/
310310
private function populateAvailableTypes()
311311
{
312-
$this->types = array();
313-
$this->ambiguousServiceTypes = array();
312+
$this->types = [];
313+
$this->ambiguousServiceTypes = [];
314314

315315
foreach ($this->container->getDefinitions() as $id => $definition) {
316316
$this->populateAvailableType($id, $definition);
@@ -361,7 +361,7 @@ private function set(string $type, string $id)
361361

362362
// keep an array of all services matching this type
363363
if (!isset($this->ambiguousServiceTypes[$type])) {
364-
$this->ambiguousServiceTypes[$type] = array($this->types[$type]);
364+
$this->ambiguousServiceTypes[$type] = [$this->types[$type]];
365365
unset($this->types[$type]);
366366
}
367367
$this->ambiguousServiceTypes[$type][] = $id;
@@ -436,7 +436,7 @@ private function createTypeAlternatives(TypedReference $reference)
436436

437437
private function getAliasesSuggestionForType($type, $extraContext = null)
438438
{
439-
$aliases = array();
439+
$aliases = [];
440440
foreach (class_parents($type) + class_implements($type) as $parent) {
441441
if ($this->container->has($parent) && !$this->container->findDefinition($parent)->isAbstract()) {
442442
$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/Compiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class Compiler
2323
{
2424
private $passConfig;
25-
private $log = array();
25+
private $log = [];
2626
private $serviceReferenceGraph;
2727

2828
public function __construct()
@@ -95,7 +95,7 @@ public function compile(ContainerBuilder $container)
9595
$pass->process($container);
9696
}
9797
} catch (\Exception $e) {
98-
$usedEnvs = array();
98+
$usedEnvs = [];
9999
$prev = $e;
100100

101101
do {

Compiler/DecoratorServicePass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public function process(ContainerBuilder $container)
3232
if (!$decorated = $definition->getDecoratedService()) {
3333
continue;
3434
}
35-
$definitions->insert(array($id, $definition), array($decorated[2], --$order));
35+
$definitions->insert([$id, $definition], [$decorated[2], --$order]);
3636
}
37-
$decoratingDefinitions = array();
37+
$decoratingDefinitions = [];
3838

3939
foreach ($definitions as list($id, $definition)) {
4040
list($inner, $renamedId) = $definition->getDecoratedService();
@@ -65,7 +65,7 @@ public function process(ContainerBuilder $container)
6565
if (isset($decoratingDefinitions[$inner])) {
6666
$decoratingDefinition = $decoratingDefinitions[$inner];
6767
$definition->setTags(array_merge($decoratingDefinition->getTags(), $definition->getTags()));
68-
$decoratingDefinition->setTags(array());
68+
$decoratingDefinition->setTags([]);
6969
$decoratingDefinitions[$inner] = $definition;
7070
}
7171

Compiler/MergeExtensionConfigurationPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function freezeAfterProcessing(Extension $extension, ContainerBuilder $co
119119
// Extension::processConfiguration() wasn't called, we cannot know how configs were merged
120120
return;
121121
}
122-
$this->processedEnvPlaceholders = array();
122+
$this->processedEnvPlaceholders = [];
123123

124124
// serialize config and container to catch env vars nested in object graphs
125125
$config = serialize($config).serialize($container->getDefinitions()).serialize($container->getAliases()).serialize($container->getParameterBag()->all());
@@ -144,7 +144,7 @@ public function getEnvPlaceholders()
144144

145145
public function getUnusedEnvPlaceholders(): array
146146
{
147-
return null === $this->processedEnvPlaceholders ? array() : array_diff_key(parent::getEnvPlaceholders(), $this->processedEnvPlaceholders);
147+
return null === $this->processedEnvPlaceholders ? [] : array_diff_key(parent::getEnvPlaceholders(), $this->processedEnvPlaceholders);
148148
}
149149
}
150150

0 commit comments

Comments
 (0)