@@ -48,8 +48,7 @@ public function register()
4848 * Processes this sniff, when one of its tokens is encountered.
4949 *
5050 * @param File $phpcsFile The current file being checked.
51- * @param int $stackPtr The position of the current token in
52- * the stack passed in $tokens.
51+ * @param int $stackPtr The position of the current token in the stack passed in $tokens.
5352 *
5453 * @return void
5554 */
@@ -123,8 +122,8 @@ public function process(File $phpcsFile, $stackPtr)
123122 }
124123 }
125124
126- // We can return here because there is nothing else to check. All code
127- // below can assume that the array is not empty.
125+ // We can return here because there is nothing else to check.
126+ // All code below can assume that the array is not empty.
128127 return ;
129128 }
130129
@@ -139,8 +138,7 @@ public function process(File $phpcsFile, $stackPtr)
139138 * Processes a single-line array definition.
140139 *
141140 * @param File $phpcsFile The current file being checked.
142- * @param int $stackPtr The position of the current token
143- * in the stack passed in $tokens.
141+ * @param int $stackPtr The position of the current token in the stack passed in $tokens.
144142 * @param int $arrayStart The token that starts the array definition.
145143 * @param int $arrayEnd The token that ends the array definition.
146144 *
@@ -162,8 +160,7 @@ public function processSingleLineArray(File $phpcsFile, $stackPtr, $arrayStart,
162160 }
163161
164162 if (T_COMMA === $ tokens [$ i ]['code ' ]) {
165- // Before counting this comma, make sure we are not
166- // at the end of the array.
163+ // Before counting this comma, make sure we are not at the end of the array.
167164 $ next = $ phpcsFile ->findNext (T_WHITESPACE , ($ i + 1 ), $ arrayEnd , true );
168165 if (false !== $ next ) {
169166 $ valueCount ++;
@@ -195,10 +192,7 @@ public function processSingleLineArray(File $phpcsFile, $stackPtr, $arrayStart,
195192 if (1 !== $ spaceLength ) {
196193 $ content = $ tokens [($ nextArrow - 2 )]['content ' ];
197194 $ error = 'Expected 1 space between "%s" and double arrow; %s found ' ;
198- $ data = array (
199- $ content ,
200- $ spaceLength ,
201- );
195+ $ data = array ($ content , $ spaceLength );
202196
203197 $ fix = $ phpcsFile ->addFixableError ($ error , $ nextArrow , 'SpaceBeforeDoubleArrow ' , $ data );
204198 if (true === $ fix ) {
@@ -221,10 +215,7 @@ public function processSingleLineArray(File $phpcsFile, $stackPtr, $arrayStart,
221215 if (1 !== $ spaceLength ) {
222216 $ content = $ tokens [($ nextArrow + 2 )]['content ' ];
223217 $ error = 'Expected 1 space between double arrow and "%s"; %s found ' ;
224- $ data = array (
225- $ content ,
226- $ spaceLength ,
227- );
218+ $ data = array ($ content , $ spaceLength );
228219
229220 $ fix = $ phpcsFile ->addFixableError ($ error , $ nextArrow , 'SpaceAfterDoubleArrow ' , $ data );
230221 if (true === $ fix ) {
@@ -251,10 +242,7 @@ public function processSingleLineArray(File $phpcsFile, $stackPtr, $arrayStart,
251242 if (1 !== $ spaceLength ) {
252243 $ content = $ tokens [($ comma + 2 )]['content ' ];
253244 $ error = 'Expected 1 space between comma and "%s"; %s found ' ;
254- $ data = [
255- $ content ,
256- $ spaceLength ,
257- ];
245+ $ data = [$ content , $ spaceLength ];
258246
259247 $ fix = $ phpcsFile ->addFixableError ($ error , $ comma , 'SpaceAfterComma ' , $ data );
260248 if (true === $ fix ) {
@@ -267,10 +255,7 @@ public function processSingleLineArray(File $phpcsFile, $stackPtr, $arrayStart,
267255 $ content = $ tokens [($ comma - 2 )]['content ' ];
268256 $ spaceLength = $ tokens [($ comma - 1 )]['length ' ];
269257 $ error = 'Expected 0 spaces between "%s" and comma; %s found ' ;
270- $ data = [
271- $ content ,
272- $ spaceLength ,
273- ];
258+ $ data = [$ content , $ spaceLength ];
274259
275260 $ fix = $ phpcsFile ->addFixableError ($ error , $ comma , 'SpaceBeforeComma ' , $ data );
276261 if (true === $ fix ) {
@@ -285,16 +270,15 @@ public function processSingleLineArray(File $phpcsFile, $stackPtr, $arrayStart,
285270 * Processes a multi-line array definition.
286271 *
287272 * @param File $phpcsFile The current file being checked.
288- * @param int $stackPtr The position of the current token
289- * in the stack passed in $tokens.
273+ * @param int $stackPtr The position of the current token in the stack passed in $tokens.
290274 * @param int $arrayStart The token that starts the array definition.
291275 * @param int $arrayEnd The token that ends the array definition.
292276 *
293277 * @return void
294278 */
295279 public function processMultiLineArray (File $ phpcsFile , $ stackPtr , $ arrayStart , $ arrayEnd )
296280 {
297- $ tokens = $ phpcsFile ->getTokens ();
281+ $ tokens = $ phpcsFile ->getTokens ();
298282
299283 $ indent = $ phpcsFile ->findFirstOnLine (T_WHITESPACE , $ arrayStart );
300284 if (false === $ indent ) {
@@ -316,10 +300,7 @@ public function processMultiLineArray(File $phpcsFile, $stackPtr, $arrayStart, $
316300 $ expected = ($ currentIndent );
317301 $ found = ($ tokens [$ arrayEnd ]['column ' ] - 1 );
318302 $ error = 'Closing parenthesis not aligned correctly; expected %s space(s) but found %s ' ;
319- $ data = array (
320- $ expected ,
321- $ found ,
322- );
303+ $ data = array ($ expected , $ found );
323304
324305 $ fix = $ phpcsFile ->addFixableError ($ error , $ arrayEnd , 'CloseBraceNotAligned ' , $ data );
325306 if (true === $ fix ) {
@@ -559,10 +540,7 @@ public function processMultiLineArray(File $phpcsFile, $stackPtr, $arrayStart, $
559540 $ found = ($ tokens [$ first ]['column ' ] - 1 );
560541 if ($ found !== $ expected ) {
561542 $ error = 'Array value not aligned correctly; expected %s spaces but found %s ' ;
562- $ data = array (
563- $ expected ,
564- $ found ,
565- );
543+ $ data = array ($ expected , $ found );
566544
567545 $ fix = $ phpcsFile ->addFixableError ($ error , $ value ['value ' ], 'ValueNotAligned ' , $ data );
568546 if (true === $ fix ) {
@@ -658,10 +636,7 @@ public function processMultiLineArray(File $phpcsFile, $stackPtr, $arrayStart, $
658636 $ expected = ($ indicesStart - 1 );
659637 $ found = ($ tokens [$ index ['index ' ]]['column ' ] - 1 );
660638 $ error = 'Array key not aligned correctly; expected %s spaces but found %s ' ;
661- $ data = array (
662- $ expected ,
663- $ found ,
664- );
639+ $ data = array ($ expected , $ found );
665640
666641 $ fix = $ phpcsFile ->addFixableError ($ error , $ index ['index ' ], 'KeyNotAligned ' , $ data );
667642
@@ -686,10 +661,7 @@ public function processMultiLineArray(File $phpcsFile, $stackPtr, $arrayStart, $
686661 }
687662
688663 $ error = 'Array double arrow not aligned correctly; expected %s space(s) but found %s ' ;
689- $ data = array (
690- $ expected ,
691- $ found ,
692- );
664+ $ data = array ($ expected , $ found );
693665
694666 if ('newline ' !== $ found || false === $ this ->ignoreNewLines ) {
695667 $ fix = $ phpcsFile ->addFixableError ($ error , $ index ['arrow ' ], 'DoubleArrowNotAligned ' , $ data );
@@ -814,10 +786,7 @@ public function processMultiLineArray(File $phpcsFile, $stackPtr, $arrayStart, $
814786 $ content = $ tokens [($ nextComma - 2 )]['content ' ];
815787 $ spaceLength = $ tokens [($ nextComma - 1 )]['length ' ];
816788 $ error = 'Expected 0 spaces between "%s" and comma; %s found ' ;
817- $ data = array (
818- $ content ,
819- $ spaceLength ,
820- );
789+ $ data = array ($ content , $ spaceLength );
821790
822791 $ fix = $ phpcsFile ->addFixableError ($ error , $ nextComma , 'SpaceBeforeComma ' , $ data );
823792 if (true === $ fix ) {
0 commit comments