@@ -301,8 +301,9 @@ public function processHeaderLines(File $phpcsFile, $headerLines)
301
301
// this block.
302
302
$ next = $ phpcsFile ->findNext (T_WHITESPACE , ($ line ['end ' ] + 1 ), null , true );
303
303
if ($ next !== false && $ tokens [$ next ]['line ' ] !== ($ tokens [$ line ['end ' ]]['line ' ] + 2 )) {
304
- $ error = 'Header blocks must be separated by a single blank line ' ;
305
- $ fix = $ phpcsFile ->addFixableError ($ error , $ line ['end ' ], 'SpacingAfterBlock ' );
304
+ $ error = 'Header blocks must be separated by a single blank line ' ;
305
+ $ errorCode = 'SpacingAfter ' .str_replace (' ' , '' , ucwords ($ line ['type ' ])).'Block ' ;
306
+ $ fix = $ phpcsFile ->addFixableError ($ error , $ line ['end ' ], $ errorCode );
306
307
if ($ fix === true ) {
307
308
if ($ tokens [$ next ]['line ' ] === $ tokens [$ line ['end ' ]]['line ' ]) {
308
309
$ phpcsFile ->fixer ->addContentBefore ($ next , $ phpcsFile ->eolChar .$ phpcsFile ->eolChar );
@@ -340,8 +341,9 @@ public function processHeaderLines(File $phpcsFile, $headerLines)
340
341
// blank line after this statement.
341
342
$ next = $ phpcsFile ->findNext (T_WHITESPACE , ($ line ['end ' ] + 1 ), null , true );
342
343
if ($ tokens [$ next ]['line ' ] > ($ tokens [$ line ['end ' ]]['line ' ] + 1 )) {
343
- $ error = 'Header blocks must not contain blank lines ' ;
344
- $ fix = $ phpcsFile ->addFixableError ($ error , $ line ['end ' ], 'SpacingInsideBlock ' );
344
+ $ error = 'Header blocks must not contain blank lines ' ;
345
+ $ errorCode = 'SpacingInside ' .str_replace (' ' , '' , ucwords ($ line ['type ' ])).'Block ' ;
346
+ $ fix = $ phpcsFile ->addFixableError ($ error , $ line ['end ' ], $ errorCode );
345
347
if ($ fix === true ) {
346
348
$ phpcsFile ->fixer ->beginChangeset ();
347
349
for ($ i = ($ line ['end ' ] + 1 ); $ i < $ next ; $ i ++) {
@@ -358,7 +360,7 @@ public function processHeaderLines(File $phpcsFile, $headerLines)
358
360
359
361
$ phpcsFile ->fixer ->endChangeset ();
360
362
}
361
- }
363
+ }//end if
362
364
}//end if
363
365
364
366
if (isset ($ found [$ line ['type ' ]]) === false ) {
0 commit comments