| @@ 155-166 (lines=12) @@ | ||
| 152 | $length = strlen($tokens[($use - 1)]['content']); |
|
| 153 | } |
|
| 154 | ||
| 155 | if ($length !== 1) { |
|
| 156 | $error = 'Expected 1 space before USE keyword; found %s'; |
|
| 157 | $data = array($length); |
|
| 158 | $fix = $phpcsFile->addFixableError($error, $use, 'SpaceBeforeUse', $data); |
|
| 159 | if ($fix === true) { |
|
| 160 | if ($length === 0) { |
|
| 161 | $phpcsFile->fixer->addContentBefore($use, ' '); |
|
| 162 | } else { |
|
| 163 | $phpcsFile->fixer->replaceToken(($use - 1), ' '); |
|
| 164 | } |
|
| 165 | } |
|
| 166 | } |
|
| 167 | }//end if |
|
| 168 | }//end if |
|
| 169 | ||
| @@ 411-423 (lines=13) @@ | ||
| 408 | $length = strlen($prev['content']); |
|
| 409 | } |
|
| 410 | ||
| 411 | if ($length !== 1) { |
|
| 412 | $error = 'There must be a single space between the closing parenthesis and the opening brace of a multi-line function declaration; found %s spaces'; |
|
| 413 | $fix = $phpcsFile->addFixableError($error, ($opener - 1), 'SpaceBeforeOpenBrace', array($length)); |
|
| 414 | if ($fix === true) { |
|
| 415 | if ($length === 0) { |
|
| 416 | $phpcsFile->fixer->addContentBefore($opener, ' '); |
|
| 417 | } else { |
|
| 418 | $phpcsFile->fixer->replaceToken(($opener - 1), ' '); |
|
| 419 | } |
|
| 420 | } |
|
| 421 | ||
| 422 | return; |
|
| 423 | }//end if |
|
| 424 | }//end if |
|
| 425 | ||
| 426 | }//end processMultiLineDeclaration() |
|
| @@ 389-400 (lines=12) @@ | ||
| 386 | $trailingSpace = strlen($tokens[($closeTag - 1)]['content']); |
|
| 387 | } |
|
| 388 | ||
| 389 | if ($trailingSpace !== 1) { |
|
| 390 | $error = 'Expected 1 space before closing PHP tag; %s found'; |
|
| 391 | $data = array($trailingSpace); |
|
| 392 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBeforeClose', $data); |
|
| 393 | if ($fix === true) { |
|
| 394 | if ($trailingSpace === 0) { |
|
| 395 | $phpcsFile->fixer->addContentBefore($closeTag, ' '); |
|
| 396 | } else { |
|
| 397 | $phpcsFile->fixer->replaceToken(($closeTag - 1), ' '); |
|
| 398 | } |
|
| 399 | } |
|
| 400 | } |
|
| 401 | ||
| 402 | }//end _validateInlineEmbeddedPhp() |
|
| 403 | ||