Skip to content

Commit 04f2659

Browse files
committed
minor symfony#19124 fixed CS (fabpot)
This PR was merged into the 3.1 branch. Discussion ---------- fixed CS | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a I submit this one to check that everyone is ok to NOT mix short array notations with long array notations in Symfony even in 3.x. Consistency is better IMHO. Commits ------- a39afd0 fixed CS
2 parents 9cbec2c + a39afd0 commit 04f2659

File tree

16 files changed

+36
-42
lines changed

16 files changed

+36
-42
lines changed

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterMappingsPassTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ class RegisterMappingsPassTest extends \PHPUnit_Framework_TestCase
1414
*/
1515
public function testNoDriverParmeterException()
1616
{
17-
$container = $this->createBuilder([
17+
$container = $this->createBuilder(array(
1818

19-
]);
20-
$this->process($container, [
19+
));
20+
$this->process($container, array(
2121
'manager.param.one',
2222
'manager.param.two',
23-
]);
23+
));
2424
}
2525

2626
private function process(ContainerBuilder $container, array $managerParamNames)
2727
{
2828
$pass = new ConcreteMappingsPass(
2929
new Definition('\stdClass'),
30-
[],
30+
array(),
3131
$managerParamNames,
3232
'some.%s.metadata_driver'
3333
);

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
276276

277277
$calls = $definition->getMethodCalls();
278278
if (count($calls) > 0) {
279-
$callInformation = [];
279+
$callInformation = array();
280280
foreach ($calls as $call) {
281281
$callInformation[] = $call[0];
282282
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
911911
// Run after serializer.normalizer.object
912912
$definition = $container->register('serializer.normalizer.data_uri', DataUriNormalizer::class);
913913
$definition->setPublic(false);
914-
$definition->addTag('serializer.normalizer', ['priority' => -920]);
914+
$definition->addTag('serializer.normalizer', array('priority' => -920));
915915
}
916916

917917
if (class_exists('Symfony\Component\Serializer\Normalizer\DateTimeNormalizer')) {

src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ public function testCreateResourceForClass($className, $isEqual)
457457
public function getCreateResourceTests()
458458
{
459459
return array(
460-
['IdenticalClassResource', true],
461-
['ClassChangedConstructorArgs', false],
460+
array('IdenticalClassResource', true),
461+
array('ClassChangedConstructorArgs', false),
462462
);
463463
}
464464

src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
157157

158158
if (is_string($label) && !is_callable($label)) {
159159
$label = new PropertyPath($label);
160-
} elseif (is_string($label) && is_callable($label)) {
160+
} elseif (is_string($label) && is_callable($label)) {
161161
@trigger_error('Passing callable strings is deprecated since version 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
162162
}
163163

src/Symfony/Component/Form/Tests/ChoiceList/Factory/PropertyAccessDecoratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function testCreateViewPreferredChoicesAsPropertyPathWithCallableString()
180180
->with($list, 'end')
181181
->willReturn('RESULT');
182182

183-
$this->assertSame('RESULT',$this->factory->createView(
183+
$this->assertSame('RESULT', $this->factory->createView(
184184
$list,
185185
'end'
186186
));

src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private function getType(\ReflectionParameter $parameter)
101101
$refClass = $parameter->getClass();
102102
} catch (\ReflectionException $e) {
103103
// mandatory; extract it from the exception message
104-
return str_replace(['Class ', ' does not exist'], '', $e->getMessage());
104+
return str_replace(array('Class ', ' does not exist'), '', $e->getMessage());
105105
}
106106

107107
return $refClass ? $refClass->getName() : null;

src/Symfony/Component/HttpKernel/Tests/ControllerMetadata/ArgumentMetadataFactoryTest.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function setUp()
2828

2929
public function testSignature1()
3030
{
31-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature1']);
31+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature1'));
3232

3333
$this->assertEquals(array(
3434
new ArgumentMetadata('foo', self::class, false, false, null),
@@ -39,7 +39,7 @@ public function testSignature1()
3939

4040
public function testSignature2()
4141
{
42-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature2']);
42+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature2'));
4343

4444
$this->assertEquals(array(
4545
new ArgumentMetadata('foo', self::class, false, true, null),
@@ -50,7 +50,7 @@ public function testSignature2()
5050

5151
public function testSignature3()
5252
{
53-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature3']);
53+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature3'));
5454

5555
$this->assertEquals(array(
5656
new ArgumentMetadata('bar', __NAMESPACE__.'\FakeClassThatDoesNotExist', false, false, null),
@@ -60,18 +60,18 @@ public function testSignature3()
6060

6161
public function testSignature4()
6262
{
63-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature4']);
63+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature4'));
6464

6565
$this->assertEquals(array(
6666
new ArgumentMetadata('foo', null, false, true, 'default'),
6767
new ArgumentMetadata('bar', null, false, true, 500),
68-
new ArgumentMetadata('baz', null, false, true, []),
68+
new ArgumentMetadata('baz', null, false, true, array()),
6969
), $arguments);
7070
}
7171

7272
public function testSignature5()
7373
{
74-
$arguments = $this->factory->createArgumentMetadata([$this, 'signature5']);
74+
$arguments = $this->factory->createArgumentMetadata(array($this, 'signature5'));
7575

7676
$this->assertEquals(array(
7777
new ArgumentMetadata('foo', 'array', false, true, null),
@@ -84,7 +84,7 @@ public function testSignature5()
8484
*/
8585
public function testVariadicSignature()
8686
{
87-
$arguments = $this->factory->createArgumentMetadata([new VariadicController(), 'action']);
87+
$arguments = $this->factory->createArgumentMetadata(array(new VariadicController(), 'action'));
8888

8989
$this->assertEquals(array(
9090
new ArgumentMetadata('foo', null, false, false, null),
@@ -97,7 +97,7 @@ public function testVariadicSignature()
9797
*/
9898
public function testBasicTypesSignature()
9999
{
100-
$arguments = $this->factory->createArgumentMetadata([new BasicTypesController(), 'action']);
100+
$arguments = $this->factory->createArgumentMetadata(array(new BasicTypesController(), 'action'));
101101

102102
$this->assertEquals(array(
103103
new ArgumentMetadata('foo', 'string', false, false, null),
@@ -108,26 +108,21 @@ public function testBasicTypesSignature()
108108

109109
private function signature1(ArgumentMetadataFactoryTest $foo, array $bar, callable $baz)
110110
{
111-
112111
}
113112

114113
private function signature2(ArgumentMetadataFactoryTest $foo = null, FakeClassThatDoesNotExist $bar = null, ImportedAndFake $baz = null)
115114
{
116-
117115
}
118116

119117
private function signature3(FakeClassThatDoesNotExist $bar, ImportedAndFake $baz)
120118
{
121-
122119
}
123120

124-
private function signature4($foo = 'default', $bar = 500, $baz = [])
121+
private function signature4($foo = 'default', $bar = 500, $baz = array())
125122
{
126-
127123
}
128124

129125
private function signature5(array $foo = null, $bar)
130126
{
131-
132127
}
133128
}

src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
interface AuthenticationProviderInterface extends AuthenticationManagerInterface
2626
{
2727
/**
28-
* Use this constant for not provided username
28+
* Use this constant for not provided username.
2929
*
3030
* @var string
3131
*/

src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ protected function isAttributeToNormalize($object, $attributeName, &$context)
238238
*/
239239
private function validateAndDenormalize($currentClass, $attribute, $data, $format, array $context)
240240
{
241-
if (null === $this->propertyTypeExtractor || null === $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)){
241+
if (null === $this->propertyTypeExtractor || null === $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) {
242242
return $data;
243243
}
244244

src/Symfony/Component/Serializer/Tests/Normalizer/JsonSerializableNormalizerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testNormalize()
4949
$this->serializer
5050
->expects($this->once())
5151
->method('normalize')
52-
->will($this->returnCallback(function($data) {
52+
->will($this->returnCallback(function ($data) {
5353
$this->assertArraySubset(array('foo' => 'a', 'bar' => 'b', 'baz' => 'c'), $data);
5454

5555
return 'string_object';
@@ -69,7 +69,7 @@ public function testCircularNormalize()
6969
$this->serializer
7070
->expects($this->once())
7171
->method('normalize')
72-
->will($this->returnCallback(function($data, $format, $context) {
72+
->will($this->returnCallback(function ($data, $format, $context) {
7373
$this->normalizer->normalize($data['qux'], $format, $context);
7474

7575
return 'string_object';

src/Symfony/Component/Serializer/Tests/SerializerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function testNormalizerAware()
324324
->method('setNormalizer')
325325
->with($this->isInstanceOf(NormalizerInterface::class));
326326

327-
new Serializer([$normalizerAware]);
327+
new Serializer(array($normalizerAware));
328328
}
329329

330330
public function testDenormalizerAware()
@@ -334,7 +334,7 @@ public function testDenormalizerAware()
334334
->method('setDenormalizer')
335335
->with($this->isInstanceOf(DenormalizerInterface::class));
336336

337-
new Serializer([$denormalizerAware]);
337+
new Serializer(array($denormalizerAware));
338338
}
339339
}
340340

src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,21 +232,21 @@ public function testPayloadIsPassedToCallback()
232232
$object = new \stdClass();
233233
$payloadCopy = null;
234234

235-
$constraint = new Callback([
236-
'callback' => function($object, ExecutionContextInterface $constraint, $payload) use (&$payloadCopy) {
237-
$payloadCopy = $payload;
235+
$constraint = new Callback(array(
236+
'callback' => function ($object, ExecutionContextInterface $constraint, $payload) use (&$payloadCopy) {
237+
$payloadCopy = $payload;
238238
},
239239
'payload' => 'Hello world!',
240-
]);
240+
));
241241
$this->validator->validate($object, $constraint);
242242
$this->assertEquals('Hello world!', $payloadCopy);
243243

244244
$payloadCopy = null;
245-
$constraint = new Callback([
246-
'callback' => function($object, ExecutionContextInterface $constraint, $payload) use (&$payloadCopy) {
247-
$payloadCopy = $payload;
245+
$constraint = new Callback(array(
246+
'callback' => function ($object, ExecutionContextInterface $constraint, $payload) use (&$payloadCopy) {
247+
$payloadCopy = $payload;
248248
},
249-
]);
249+
));
250250
$this->validator->validate($object, $constraint);
251251
$this->assertNull($payloadCopy);
252252
}

src/Symfony/Component/VarDumper/Tests/CliDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function testFlags()
163163
putenv('DUMP_STRING_LENGTH=1');
164164

165165
$var = array(
166-
range(1,3),
166+
range(1, 3),
167167
array('foo', 2 => 'bar'),
168168
);
169169

src/Symfony/Component/Yaml/Tests/DumperTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ public function testNonUtf8DataIsDumpedBase64Encoded()
296296
*/
297297
public function testDumpObjectAsMap($object, $expected)
298298
{
299-
300299
$yaml = $this->dumper->dump($object, 0, 0, Yaml::DUMP_OBJECT_AS_MAP);
301300

302301
$this->assertEquals($expected, Yaml::parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));

0 commit comments

Comments
 (0)