Skip to content

Commit 23afcf4

Browse files
committed
fixed short array CS in comments
1 parent 53a7ada commit 23afcf4

File tree

7 files changed

+57
-57
lines changed

7 files changed

+57
-57
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The edge case of defining just one value for nodes of type Enum is now allowed:
3434
$rootNode
3535
->children()
3636
->enumNode('variable')
37-
->values(array('value'))
37+
->values(['value'])
3838
->end()
3939
->end()
4040
;

Definition/ArrayNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getChildren()
8282
/**
8383
* Sets the xml remappings that should be performed.
8484
*
85-
* @param array $remappings An array of the form array(array(string, string))
85+
* @param array $remappings An array of the form [[string, string]]
8686
*/
8787
public function setXmlRemappings(array $remappings)
8888
{
@@ -92,7 +92,7 @@ public function setXmlRemappings(array $remappings)
9292
/**
9393
* Gets the xml remappings that should be performed.
9494
*
95-
* @return array an array of the form array(array(string, string))
95+
* @return array an array of the form [[string, string]]
9696
*/
9797
public function getXmlRemappings()
9898
{

Definition/Builder/ArrayNodeDefinition.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ public function fixXmlConfig($singular, $plural = null)
214214
* to be the key of the particular item. For example, if "id" is the
215215
* "key", then:
216216
*
217-
* array(
218-
* array('id' => 'my_name', 'foo' => 'bar'),
219-
* );
217+
* [
218+
* ['id' => 'my_name', 'foo' => 'bar'],
219+
* ];
220220
*
221221
* becomes
222222
*
223-
* array(
224-
* 'my_name' => array('foo' => 'bar'),
225-
* );
223+
* [
224+
* 'my_name' => ['foo' => 'bar'],
225+
* ];
226226
*
227227
* If you'd like "'id' => 'my_name'" to still be present in the resulting
228228
* array, then you can set the second argument of this method to false.

Definition/PrototypedArrayNode.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ public function setMinNumberOfElements($number)
5353
* to be the key of the particular item. For example, if "id" is the
5454
* "key", then:
5555
*
56-
* array(
57-
* array('id' => 'my_name', 'foo' => 'bar'),
58-
* );
56+
* [
57+
* ['id' => 'my_name', 'foo' => 'bar'],
58+
* ];
5959
*
6060
* becomes
6161
*
62-
* array(
63-
* 'my_name' => array('foo' => 'bar'),
64-
* );
62+
* [
63+
* 'my_name' => ['foo' => 'bar'],
64+
* ];
6565
*
6666
* If you'd like "'id' => 'my_name'" to still be present in the resulting
6767
* array, then you can set the second argument of this method to false.
@@ -335,30 +335,30 @@ protected function mergeValues($leftSide, $rightSide)
335335
*
336336
* For example, assume $this->keyAttribute is 'name' and the value array is as follows:
337337
*
338-
* array(
339-
* array(
338+
* [
339+
* [
340340
* 'name' => 'name001',
341341
* 'value' => 'value001'
342-
* )
343-
* )
342+
* ]
343+
* ]
344344
*
345345
* Now, the key is 0 and the child node is:
346346
*
347-
* array(
347+
* [
348348
* 'name' => 'name001',
349349
* 'value' => 'value001'
350-
* )
350+
* ]
351351
*
352352
* When normalizing the value array, the 'name' element will removed from the child node
353353
* and its value becomes the new key of the child node:
354354
*
355-
* array(
356-
* 'name001' => array('value' => 'value001')
357-
* )
355+
* [
356+
* 'name001' => ['value' => 'value001']
357+
* ]
358358
*
359359
* Now only 'value' element is left in the child node which can be further simplified into a string:
360360
*
361-
* array('name001' => 'value001')
361+
* ['name001' => 'value001']
362362
*
363363
* Now, the key becomes 'name001' and the child node becomes 'value001' and
364364
* the prototype of child node 'name001' should be a ScalarNode instead of an ArrayNode instance.

Tests/Definition/Builder/ExprBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ protected function getTestBuilder()
227227
*
228228
* @param TreeBuilder $testBuilder The tree builder to finalize
229229
* @param array $config The config you want to use for the finalization, if nothing provided
230-
* a simple array('key'=>'value') will be used
230+
* a simple ['key'=>'value'] will be used
231231
*
232232
* @return array The finalized config values
233233
*/

Tests/Definition/PrototypedArrayNodeTest.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ public function testRemappedKeysAreUnset()
6666
* The above should finally be mapped to an array that looks like this
6767
* (because "id" is the key attribute).
6868
*
69-
* array(
70-
* 'things' => array(
69+
* [
70+
* 'things' => [
7171
* 'option1' => 'foo',
7272
* 'option2' => 'bar',
73-
* )
74-
* )
73+
* ]
74+
* ]
7575
*/
7676
public function testMappedAttributeKeyIsRemoved()
7777
{
@@ -191,11 +191,11 @@ protected function getPrototypeNodeWithDefaultChildren()
191191
* The above should finally be mapped to an array that looks like this
192192
* (because "id" is the key attribute).
193193
*
194-
* array(
195-
* 'things' => array(
194+
* [
195+
* 'things' => [
196196
* 'option1' => 'value1'
197-
* )
198-
* )
197+
* ]
198+
* ]
199199
*
200200
* It's also possible to mix 'value-only' and 'non-value-only' elements in the array.
201201
*
@@ -206,15 +206,15 @@ protected function getPrototypeNodeWithDefaultChildren()
206206
*
207207
* The above should finally be mapped to an array as follows
208208
*
209-
* array(
210-
* 'things' => array(
209+
* [
210+
* 'things' => [
211211
* 'option1' => 'value1',
212-
* 'option2' => array(
212+
* 'option2' => [
213213
* 'value' => 'value2',
214214
* 'foo' => 'foo2'
215-
* )
216-
* )
217-
* )
215+
* ]
216+
* ]
217+
* ]
218218
*
219219
* The 'value' element can also be ArrayNode:
220220
*
@@ -229,14 +229,14 @@ protected function getPrototypeNodeWithDefaultChildren()
229229
*
230230
* The above should be finally be mapped to an array as follows
231231
*
232-
* array(
233-
* 'things' => array(
234-
* 'option1' => array(
232+
* [
233+
* 'things' => [
234+
* 'option1' => [
235235
* 'foo' => 'foo1',
236236
* 'bar' => 'bar1'
237-
* )
238-
* )
239-
* )
237+
* ]
238+
* ]
239+
* ]
240240
*
241241
* If using VariableNode for value node, it's also possible to mix different types of value nodes:
242242
*
@@ -252,15 +252,15 @@ protected function getPrototypeNodeWithDefaultChildren()
252252
*
253253
* The above should be finally mapped to an array as follows
254254
*
255-
* array(
256-
* 'things' => array(
257-
* 'option1' => array(
255+
* [
256+
* 'things' => [
257+
* 'option1' => [
258258
* 'foo' => 'foo1',
259259
* 'bar' => 'bar1'
260-
* ),
260+
* ],
261261
* 'option2' => 'value2'
262-
* )
263-
* )
262+
* ]
263+
* ]
264264
*
265265
*
266266
* @dataProvider getDataForKeyRemovedLeftValueOnly

Tests/Resource/ReflectionClassResourceTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ public function testHashedSignature($changeExpected, $changedLine, $changedCode)
7171
/* 2*/ {
7272
/* 3*/ const FOO = 123;
7373
/* 4*/
74-
/* 5*/ public $pub = array();
74+
/* 5*/ public $pub = [];
7575
/* 6*/
7676
/* 7*/ protected $prot;
7777
/* 8*/
7878
/* 9*/ private $priv;
7979
/*10*/
8080
/*11*/ public function pub($arg = null) {}
8181
/*12*/
82-
/*13*/ protected function prot($a = array()) {}
82+
/*13*/ protected function prot($a = []) {}
8383
/*14*/
8484
/*15*/ private function priv() {}
8585
/*16*/ }
@@ -119,8 +119,8 @@ public function provideHashedSignature()
119119
yield [1, 3, 'const FOO = 456;'];
120120
yield [1, 3, 'const BAR = 123;'];
121121
yield [1, 4, '/** pub docblock */'];
122-
yield [1, 5, 'protected $pub = array();'];
123-
yield [1, 5, 'public $pub = array(123);'];
122+
yield [1, 5, 'protected $pub = [];'];
123+
yield [1, 5, 'public $pub = [123];'];
124124
yield [1, 6, '/** prot docblock */'];
125125
yield [1, 7, 'private $prot;'];
126126
yield [0, 8, '/** priv docblock */'];
@@ -134,7 +134,7 @@ public function provideHashedSignature()
134134
}
135135
yield [0, 11, "public function pub(\$arg = null) {\nreturn 123;\n}"];
136136
yield [1, 12, '/** prot docblock */'];
137-
yield [1, 13, 'protected function prot($a = array(123)) {}'];
137+
yield [1, 13, 'protected function prot($a = [123]) {}'];
138138
yield [0, 14, '/** priv docblock */'];
139139
yield [0, 15, ''];
140140
}

0 commit comments

Comments
 (0)