@@ -118,10 +118,8 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
118118 } else {
119119 $ this ->processMultiLineArray ($ phpcsFile , $ stackPtr , $ arrayStart , $ arrayEnd );
120120 }
121-
122121 }
123122
124-
125123 /**
126124 * Processes a single-line array definition.
127125 *
@@ -183,9 +181,9 @@ public function processSingleLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPt
183181 $ content = $ tokens [($ nextArrow - 2 )]['content ' ];
184182 $ error = 'Expected 1 space between "%s" and double arrow; %s found ' ;
185183 $ data = array (
186- $ content ,
187- $ spaceLength ,
188- );
184+ $ content ,
185+ $ spaceLength ,
186+ );
189187
190188 $ fix = $ phpcsFile ->addFixableError ($ error , $ nextArrow , 'SpaceBeforeDoubleArrow ' , $ data );
191189 if ($ fix === true ) {
@@ -208,9 +206,9 @@ public function processSingleLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPt
208206 $ content = $ tokens [($ nextArrow + 2 )]['content ' ];
209207 $ error = 'Expected 1 space between double arrow and "%s"; %s found ' ;
210208 $ data = array (
211- $ content ,
212- $ spaceLength ,
213- );
209+ $ content ,
210+ $ spaceLength ,
211+ );
214212
215213 $ fix = $ phpcsFile ->addFixableError ($ error , $ nextArrow , 'SpaceAfterDoubleArrow ' , $ data );
216214 if ($ fix === true ) {
@@ -266,7 +264,6 @@ public function processSingleLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPt
266264 }
267265 }
268266
269-
270267 /**
271268 * Processes a multi-line array definition.
272269 *
@@ -417,9 +414,9 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
417414
418415 $ error = 'Expected 0 spaces between "%s" and comma; %s found ' ;
419416 $ data = array (
420- $ content ,
421- $ spaceLength ,
422- );
417+ $ content ,
418+ $ spaceLength ,
419+ );
423420
424421 $ fix = $ phpcsFile ->addFixableError ($ error , $ nextToken , 'SpaceBeforeComma ' , $ data );
425422 if ($ fix === true ) {
@@ -547,9 +544,9 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
547544 if ($ found !== $ expected ) {
548545 $ error = 'Array value not aligned correctly; expected %s spaces but found %s ' ;
549546 $ data = array (
550- $ expected ,
551- $ found ,
552- );
547+ $ expected ,
548+ $ found ,
549+ );
553550
554551 $ fix = $ phpcsFile ->addFixableError ($ error , $ value ['value ' ], 'ValueNotAligned ' , $ data );
555552 if ($ fix === true ) {
@@ -646,9 +643,9 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
646643 $ found = ($ tokens [$ index ['index ' ]]['column ' ] - 1 );
647644 $ error = 'Array key not aligned correctly; expected %s spaces but found %s ' ;
648645 $ data = array (
649- $ expected ,
650- $ found ,
651- );
646+ $ expected ,
647+ $ found ,
648+ );
652649
653650 $ fix = $ phpcsFile ->addFixableError ($ error , $ index ['index ' ], 'KeyNotAligned ' , $ data );
654651
@@ -665,17 +662,18 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
665662
666663 if ($ tokens [$ index ['arrow ' ]]['column ' ] !== $ arrowStart ) {
667664 $ expected = ($ arrowStart - (strlen ($ index ['index_content ' ]) + $ tokens [$ index ['index ' ]]['column ' ]));
668- $ found = ($ tokens [$ index ['arrow ' ]]['column ' ] - (strlen ($ index ['index_content ' ]) + $ tokens [$ index ['index ' ]]['column ' ]));
665+ $ found = $ tokens [$ index ['arrow ' ]]['column ' ]
666+ - (strlen ($ index ['index_content ' ]) + $ tokens [$ index ['index ' ]]['column ' ]);
669667
670668 if ($ found < 0 ) {
671669 $ found = 'newline ' ;
672670 }
673671
674672 $ error = 'Array double arrow not aligned correctly; expected %s space(s) but found %s ' ;
675673 $ data = array (
676- $ expected ,
677- $ found ,
678- );
674+ $ expected ,
675+ $ found ,
676+ );
679677
680678 if ($ found !== 'newline ' || $ this ->ignoreNewLine === false ) {
681679 $ fix = $ phpcsFile ->addFixableError ($ error , $ index ['arrow ' ], 'DoubleArrowNotAligned ' , $ data );
@@ -702,7 +700,9 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
702700
703701 if ($ tokens [$ index ['value ' ]]['column ' ] !== $ valueStart ) {
704702 $ expected = ($ valueStart - ($ tokens [$ index ['arrow ' ]]['length ' ] + $ tokens [$ index ['arrow ' ]]['column ' ]));
705- $ found = ($ tokens [$ index ['value ' ]]['column ' ] - ($ tokens [$ index ['arrow ' ]]['length ' ] + $ tokens [$ index ['arrow ' ]]['column ' ]));
703+ $ found = $ tokens [$ index ['value ' ]]['column ' ]
704+ - ($ tokens [$ index ['arrow ' ]]['length ' ] + $ tokens [$ index ['arrow ' ]]['column ' ]);
705+
706706 if ($ found < 0 ) {
707707 $ found = 'newline ' ;
708708 }
@@ -799,9 +799,9 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr
799799 $ spaceLength = $ tokens [($ nextComma - 1 )]['length ' ];
800800 $ error = 'Expected 0 spaces between "%s" and comma; %s found ' ;
801801 $ data = array (
802- $ content ,
803- $ spaceLength ,
804- );
802+ $ content ,
803+ $ spaceLength ,
804+ );
805805
806806 $ fix = $ phpcsFile ->addFixableError ($ error , $ nextComma , 'SpaceBeforeComma ' , $ data );
807807 if ($ fix === true ) {
0 commit comments