@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | // Check that the closing brace is on it's own line. |
| 110 | 110 | $lastContent = $phpcsFile->findPrevious( |
| 111 | 111 | array( |
| 112 | - T_WHITESPACE, |
|
| 113 | - T_INLINE_HTML, |
|
| 114 | - T_OPEN_TAG, |
|
| 112 | + T_WHITESPACE, |
|
| 113 | + T_INLINE_HTML, |
|
| 114 | + T_OPEN_TAG, |
|
| 115 | 115 | ), |
| 116 | 116 | ($scopeEnd - 1), |
| 117 | 117 | $scopeStart, |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | if ($braceIndent !== $expectedIndent) { |
| 161 | 161 | $error = 'Case breaking statement indented incorrectly; expected %s spaces, found %s'; |
| 162 | 162 | $data = array( |
| 163 | - $expectedIndent, |
|
| 164 | - $braceIndent, |
|
| 165 | - ); |
|
| 163 | + $expectedIndent, |
|
| 164 | + $braceIndent, |
|
| 165 | + ); |
|
| 166 | 166 | $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data); |
| 167 | 167 | } |
| 168 | 168 | } else { |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | if ($braceIndent !== $expectedIndent) { |
| 171 | 171 | $error = 'Closing brace indented incorrectly; expected %s spaces, found %s'; |
| 172 | 172 | $data = array( |
| 173 | - $expectedIndent, |
|
| 174 | - $braceIndent, |
|
| 175 | - ); |
|
| 173 | + $expectedIndent, |
|
| 174 | + $braceIndent, |
|
| 175 | + ); |
|
| 176 | 176 | $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); |
| 177 | 177 | } |
| 178 | 178 | }//end if |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $expectedIndent, |
| 164 | 164 | $braceIndent, |
| 165 | 165 | ); |
| 166 | - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data); |
|
| 166 | + $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data); |
|
| 167 | 167 | } |
| 168 | 168 | } else { |
| 169 | 169 | $expectedIndent = ($startColumn - 1); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $expectedIndent, |
| 174 | 174 | $braceIndent, |
| 175 | 175 | ); |
| 176 | - $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); |
|
| 176 | + $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data); |
|
| 177 | 177 | } |
| 178 | 178 | }//end if |
| 179 | 179 | |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | 36 | public $supportedTokenizers = array( |
| 37 | - 'PHP', |
|
| 38 | - 'JS', |
|
| 39 | - ); |
|
| 37 | + 'PHP', |
|
| 38 | + 'JS', |
|
| 39 | + ); |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * The number of spaces code should be indented. |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) { |
| 226 | 226 | $error = 'Expected %s spaces after opening bracket; %s found'; |
| 227 | 227 | $data = array( |
| 228 | - $this->requiredSpacesAfterOpen, |
|
| 229 | - $spaceAfterOpen, |
|
| 230 | - ); |
|
| 228 | + $this->requiredSpacesAfterOpen, |
|
| 229 | + $spaceAfterOpen, |
|
| 230 | + ); |
|
| 231 | 231 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket', $data); |
| 232 | 232 | if ($fix === true) { |
| 233 | 233 | $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); |
@@ -257,9 +257,9 @@ discard block |
||
| 257 | 257 | if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) { |
| 258 | 258 | $error = 'Expected %s spaces before closing bracket; %s found'; |
| 259 | 259 | $data = array( |
| 260 | - $this->requiredSpacesBeforeClose, |
|
| 261 | - $spaceBeforeClose, |
|
| 262 | - ); |
|
| 260 | + $this->requiredSpacesBeforeClose, |
|
| 261 | + $spaceBeforeClose, |
|
| 262 | + ); |
|
| 263 | 263 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeCloseBracket', $data); |
| 264 | 264 | if ($fix === true) { |
| 265 | 265 | $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); |
@@ -447,9 +447,9 @@ discard block |
||
| 447 | 447 | ) { |
| 448 | 448 | $error = 'Multi-line function call not indented correctly; expected %s spaces but found %s'; |
| 449 | 449 | $data = array( |
| 450 | - $expectedIndent, |
|
| 451 | - $foundIndent, |
|
| 452 | - ); |
|
| 450 | + $expectedIndent, |
|
| 451 | + $foundIndent, |
|
| 452 | + ); |
|
| 453 | 453 | |
| 454 | 454 | $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); |
| 455 | 455 | if ($fix === true) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $this->requiredSpacesAfterOpen, |
| 229 | 229 | $spaceAfterOpen, |
| 230 | 230 | ); |
| 231 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket', $data); |
|
| 231 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpenBracket', $data); |
|
| 232 | 232 | if ($fix === true) { |
| 233 | 233 | $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); |
| 234 | 234 | if ($spaceAfterOpen === 0) { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $this->requiredSpacesBeforeClose, |
| 261 | 261 | $spaceBeforeClose, |
| 262 | 262 | ); |
| 263 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeCloseBracket', $data); |
|
| 263 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeCloseBracket', $data); |
|
| 264 | 264 | if ($fix === true) { |
| 265 | 265 | $padding = str_repeat(' ', $this->requiredSpacesBeforeClose); |
| 266 | 266 | if ($spaceBeforeClose === 0) { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * Should this test be skipped for some reason. |
| 37 | 37 | * |
| 38 | - * @return void |
|
| 38 | + * @return boolean |
|
| 39 | 39 | */ |
| 40 | 40 | protected function shouldSkipTest() |
| 41 | 41 | { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | return array( |
| 47 | 47 | T_FUNCTION, |
| 48 | 48 | T_CLOSURE, |
| 49 | - ); |
|
| 49 | + ); |
|
| 50 | 50 | |
| 51 | 51 | }//end register() |
| 52 | 52 | |
@@ -353,9 +353,9 @@ discard block |
||
| 353 | 353 | if ($expectedIndent !== $foundIndent) { |
| 354 | 354 | $error = 'Multi-line function declaration not indented correctly; expected %s spaces but found %s'; |
| 355 | 355 | $data = array( |
| 356 | - $expectedIndent, |
|
| 357 | - $foundIndent, |
|
| 358 | - ); |
|
| 356 | + $expectedIndent, |
|
| 357 | + $foundIndent, |
|
| 358 | + ); |
|
| 359 | 359 | |
| 360 | 360 | $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); |
| 361 | 361 | if ($fix === true) { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * Should this test be skipped for some reason. |
| 37 | 37 | * |
| 38 | - * @return void |
|
| 38 | + * @return boolean |
|
| 39 | 39 | */ |
| 40 | 40 | protected function shouldSkipTest() |
| 41 | 41 | { |
@@ -35,51 +35,51 @@ discard block |
||
| 35 | 35 | * @var array |
| 36 | 36 | */ |
| 37 | 37 | protected $tags = array( |
| 38 | - '@category' => array( |
|
| 39 | - 'required' => true, |
|
| 40 | - 'allow_multiple' => false, |
|
| 38 | + '@category' => array( |
|
| 39 | + 'required' => true, |
|
| 40 | + 'allow_multiple' => false, |
|
| 41 | 41 | ), |
| 42 | - '@package' => array( |
|
| 43 | - 'required' => true, |
|
| 44 | - 'allow_multiple' => false, |
|
| 42 | + '@package' => array( |
|
| 43 | + 'required' => true, |
|
| 44 | + 'allow_multiple' => false, |
|
| 45 | 45 | ), |
| 46 | - '@subpackage' => array( |
|
| 47 | - 'required' => false, |
|
| 48 | - 'allow_multiple' => false, |
|
| 46 | + '@subpackage' => array( |
|
| 47 | + 'required' => false, |
|
| 48 | + 'allow_multiple' => false, |
|
| 49 | 49 | ), |
| 50 | - '@author' => array( |
|
| 51 | - 'required' => true, |
|
| 52 | - 'allow_multiple' => true, |
|
| 50 | + '@author' => array( |
|
| 51 | + 'required' => true, |
|
| 52 | + 'allow_multiple' => true, |
|
| 53 | 53 | ), |
| 54 | - '@copyright' => array( |
|
| 55 | - 'required' => false, |
|
| 56 | - 'allow_multiple' => true, |
|
| 54 | + '@copyright' => array( |
|
| 55 | + 'required' => false, |
|
| 56 | + 'allow_multiple' => true, |
|
| 57 | 57 | ), |
| 58 | - '@license' => array( |
|
| 59 | - 'required' => true, |
|
| 60 | - 'allow_multiple' => false, |
|
| 58 | + '@license' => array( |
|
| 59 | + 'required' => true, |
|
| 60 | + 'allow_multiple' => false, |
|
| 61 | 61 | ), |
| 62 | - '@version' => array( |
|
| 63 | - 'required' => false, |
|
| 64 | - 'allow_multiple' => false, |
|
| 62 | + '@version' => array( |
|
| 63 | + 'required' => false, |
|
| 64 | + 'allow_multiple' => false, |
|
| 65 | 65 | ), |
| 66 | - '@link' => array( |
|
| 67 | - 'required' => true, |
|
| 68 | - 'allow_multiple' => true, |
|
| 66 | + '@link' => array( |
|
| 67 | + 'required' => true, |
|
| 68 | + 'allow_multiple' => true, |
|
| 69 | 69 | ), |
| 70 | - '@see' => array( |
|
| 71 | - 'required' => false, |
|
| 72 | - 'allow_multiple' => true, |
|
| 70 | + '@see' => array( |
|
| 71 | + 'required' => false, |
|
| 72 | + 'allow_multiple' => true, |
|
| 73 | 73 | ), |
| 74 | - '@since' => array( |
|
| 75 | - 'required' => false, |
|
| 76 | - 'allow_multiple' => false, |
|
| 74 | + '@since' => array( |
|
| 75 | + 'required' => false, |
|
| 76 | + 'allow_multiple' => false, |
|
| 77 | 77 | ), |
| 78 | - '@deprecated' => array( |
|
| 79 | - 'required' => false, |
|
| 80 | - 'allow_multiple' => false, |
|
| 78 | + '@deprecated' => array( |
|
| 79 | + 'required' => false, |
|
| 80 | + 'allow_multiple' => false, |
|
| 81 | 81 | ), |
| 82 | - ); |
|
| 82 | + ); |
|
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -159,24 +159,24 @@ discard block |
||
| 159 | 159 | ); |
| 160 | 160 | |
| 161 | 161 | $ignore = array( |
| 162 | - T_CLASS, |
|
| 163 | - T_INTERFACE, |
|
| 164 | - T_TRAIT, |
|
| 165 | - T_FUNCTION, |
|
| 166 | - T_CLOSURE, |
|
| 167 | - T_PUBLIC, |
|
| 168 | - T_PRIVATE, |
|
| 169 | - T_PROTECTED, |
|
| 170 | - T_FINAL, |
|
| 171 | - T_STATIC, |
|
| 172 | - T_ABSTRACT, |
|
| 173 | - T_CONST, |
|
| 174 | - T_PROPERTY, |
|
| 175 | - T_INCLUDE, |
|
| 176 | - T_INCLUDE_ONCE, |
|
| 177 | - T_REQUIRE, |
|
| 178 | - T_REQUIRE_ONCE, |
|
| 179 | - ); |
|
| 162 | + T_CLASS, |
|
| 163 | + T_INTERFACE, |
|
| 164 | + T_TRAIT, |
|
| 165 | + T_FUNCTION, |
|
| 166 | + T_CLOSURE, |
|
| 167 | + T_PUBLIC, |
|
| 168 | + T_PRIVATE, |
|
| 169 | + T_PROTECTED, |
|
| 170 | + T_FINAL, |
|
| 171 | + T_STATIC, |
|
| 172 | + T_ABSTRACT, |
|
| 173 | + T_CONST, |
|
| 174 | + T_PROPERTY, |
|
| 175 | + T_INCLUDE, |
|
| 176 | + T_INCLUDE_ONCE, |
|
| 177 | + T_REQUIRE, |
|
| 178 | + T_REQUIRE_ONCE, |
|
| 179 | + ); |
|
| 180 | 180 | |
| 181 | 181 | if (in_array($tokens[$nextToken]['code'], $ignore) === true) { |
| 182 | 182 | $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); |
@@ -246,9 +246,9 @@ discard block |
||
| 246 | 246 | if ($this->tags[$name]['allow_multiple'] === false && isset($tagTokens[$name]) === true) { |
| 247 | 247 | $error = 'Only one %s tag is allowed in a %s comment'; |
| 248 | 248 | $data = array( |
| 249 | - $name, |
|
| 250 | - $docBlock, |
|
| 251 | - ); |
|
| 249 | + $name, |
|
| 250 | + $docBlock, |
|
| 251 | + ); |
|
| 252 | 252 | $phpcsFile->addError($error, $tag, 'Duplicate'.ucfirst(substr($name, 1)).'Tag', $data); |
| 253 | 253 | } |
| 254 | 254 | |
@@ -259,9 +259,9 @@ discard block |
||
| 259 | 259 | if ($string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']) { |
| 260 | 260 | $error = 'Content missing for %s tag in %s comment'; |
| 261 | 261 | $data = array( |
| 262 | - $name, |
|
| 263 | - $docBlock, |
|
| 264 | - ); |
|
| 262 | + $name, |
|
| 263 | + $docBlock, |
|
| 264 | + ); |
|
| 265 | 265 | $phpcsFile->addError($error, $tag, 'Empty'.ucfirst(substr($name, 1)).'Tag', $data); |
| 266 | 266 | continue; |
| 267 | 267 | } |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | if ($tagData['required'] === true) { |
| 275 | 275 | $error = 'Missing %s tag in %s comment'; |
| 276 | 276 | $data = array( |
| 277 | - $tag, |
|
| 278 | - $docBlock, |
|
| 279 | - ); |
|
| 277 | + $tag, |
|
| 278 | + $docBlock, |
|
| 279 | + ); |
|
| 280 | 280 | $phpcsFile->addError($error, $commentEnd, 'Missing'.ucfirst(substr($tag, 1)).'Tag', $data); |
| 281 | 281 | } |
| 282 | 282 | |
@@ -296,9 +296,9 @@ discard block |
||
| 296 | 296 | if ($foundTags[$pos] !== $tag) { |
| 297 | 297 | $error = 'The tag in position %s should be the %s tag'; |
| 298 | 298 | $data = array( |
| 299 | - ($pos + 1), |
|
| 300 | - $tag, |
|
| 301 | - ); |
|
| 299 | + ($pos + 1), |
|
| 300 | + $tag, |
|
| 301 | + ); |
|
| 302 | 302 | $phpcsFile->addError($error, $tokens[$commentStart]['comment_tags'][$pos], ucfirst(substr($tag, 1)).'TagOrder', $data); |
| 303 | 303 | } |
| 304 | 304 | |
@@ -344,9 +344,9 @@ discard block |
||
| 344 | 344 | $error = 'Category name "%s" is not valid; consider "%s" instead'; |
| 345 | 345 | $validName = trim($newName, '_'); |
| 346 | 346 | $data = array( |
| 347 | - $content, |
|
| 348 | - $validName, |
|
| 349 | - ); |
|
| 347 | + $content, |
|
| 348 | + $validName, |
|
| 349 | + ); |
|
| 350 | 350 | $phpcsFile->addError($error, $tag, 'InvalidCategory', $data); |
| 351 | 351 | } |
| 352 | 352 | }//end foreach |
@@ -397,9 +397,9 @@ discard block |
||
| 397 | 397 | $error = 'Package name "%s" is not valid; consider "%s" instead'; |
| 398 | 398 | $validName = trim($newName, '_'); |
| 399 | 399 | $data = array( |
| 400 | - $content, |
|
| 401 | - $validName, |
|
| 402 | - ); |
|
| 400 | + $content, |
|
| 401 | + $validName, |
|
| 402 | + ); |
|
| 403 | 403 | $phpcsFile->addError($error, $tag, 'InvalidPackage', $data); |
| 404 | 404 | }//end if |
| 405 | 405 | }//end foreach |
@@ -442,9 +442,9 @@ discard block |
||
| 442 | 442 | $error = 'Subpackage name "%s" is not valid; consider "%s" instead'; |
| 443 | 443 | $validName = trim($newName, '_'); |
| 444 | 444 | $data = array( |
| 445 | - $content, |
|
| 446 | - $validName, |
|
| 447 | - ); |
|
| 445 | + $content, |
|
| 446 | + $validName, |
|
| 447 | + ); |
|
| 448 | 448 | $phpcsFile->addError($error, $tag, 'InvalidSubpackage', $data); |
| 449 | 449 | }//end foreach |
| 450 | 450 | |
@@ -272,12 +272,12 @@ discard block |
||
| 272 | 272 | }//end if |
| 273 | 273 | |
| 274 | 274 | $params[] = array( |
| 275 | - 'tag' => $tag, |
|
| 276 | - 'type' => $type, |
|
| 277 | - 'var' => $var, |
|
| 278 | - 'comment' => $comment, |
|
| 279 | - 'type_space' => $typeSpace, |
|
| 280 | - 'var_space' => $varSpace, |
|
| 275 | + 'tag' => $tag, |
|
| 276 | + 'type' => $type, |
|
| 277 | + 'var' => $var, |
|
| 278 | + 'comment' => $comment, |
|
| 279 | + 'type_space' => $typeSpace, |
|
| 280 | + 'var_space' => $varSpace, |
|
| 281 | 281 | ); |
| 282 | 282 | }//end foreach |
| 283 | 283 | |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | if ($param['type_space'] !== $spaces) { |
| 305 | 305 | $error = 'Expected %s spaces after parameter type; %s found'; |
| 306 | 306 | $data = array( |
| 307 | - $spaces, |
|
| 308 | - $param['type_space'], |
|
| 309 | - ); |
|
| 307 | + $spaces, |
|
| 308 | + $param['type_space'], |
|
| 309 | + ); |
|
| 310 | 310 | |
| 311 | 311 | $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data); |
| 312 | 312 | if ($fix === true) { |
@@ -325,8 +325,8 @@ discard block |
||
| 325 | 325 | if ($realName !== $param['var']) { |
| 326 | 326 | $code = 'ParamNameNoMatch'; |
| 327 | 327 | $data = array( |
| 328 | - $param['var'], |
|
| 329 | - $realName, |
|
| 328 | + $param['var'], |
|
| 329 | + $realName, |
|
| 330 | 330 | ); |
| 331 | 331 | |
| 332 | 332 | $error = 'Doc comment for parameter %s does not match '; |
@@ -354,9 +354,9 @@ discard block |
||
| 354 | 354 | if ($param['var_space'] !== $spaces) { |
| 355 | 355 | $error = 'Expected %s spaces after parameter name; %s found'; |
| 356 | 356 | $data = array( |
| 357 | - $spaces, |
|
| 358 | - $param['var_space'], |
|
| 359 | - ); |
|
| 357 | + $spaces, |
|
| 358 | + $param['var_space'], |
|
| 359 | + ); |
|
| 360 | 360 | |
| 361 | 361 | $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data); |
| 362 | 362 | if ($fix === true) { |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | /** |
| 42 | 42 | * Returns an array of tokens this test wants to listen for. |
| 43 | 43 | * |
| 44 | - * @return array |
|
| 44 | + * @return integer[] |
|
| 45 | 45 | */ |
| 46 | 46 | public function register() |
| 47 | 47 | { |
@@ -35,8 +35,8 @@ |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | class IncorrectBracePlacement |
| 38 | - { |
|
| 39 | - } |
|
| 38 | + { |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | 41 | abstract class CodeSnifferFail |
| 42 | 42 | extends |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | if (($condition1 |
| 53 | 53 | || $condition2) |
| 54 | - ) { |
|
| 54 | + ) { |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | if ( |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | if (($condition1 |
| 48 | 48 | || $condition2) |
| 49 | -) { |
|
| 49 | +) { |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (($condition1 |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | -if ( $condition1 |
|
| 67 | +if ($condition1 |
|
| 68 | 68 | || $condition2 |
| 69 | 69 | || $condition3 |
| 70 | 70 | ) { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | if ($condition1 |
| 100 | 100 | || $condition2 || $condition3 |
| 101 | -){ |
|
| 101 | +) { |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ($condition1) |
@@ -101,19 +101,22 @@ discard block |
||
| 101 | 101 | ){ |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -if ($condition1) |
|
| 104 | +if ($condition1) { |
|
| 105 | 105 | echo 'bar'; |
| 106 | +} |
|
| 106 | 107 | |
| 107 | 108 | if ($condition1 |
| 108 | 109 | || $condition2 |
| 109 | -|| $condition3) |
|
| 110 | +|| $condition3) { |
|
| 110 | 111 | echo 'bar'; |
| 112 | +} |
|
| 111 | 113 | |
| 112 | 114 | |
| 113 | 115 | if ($condition1 |
| 114 | 116 | || $condition2 || $condition3 |
| 115 | -) |
|
| 117 | +) { |
|
| 116 | 118 | echo 'bar'; |
| 119 | +} |
|
| 117 | 120 | |
| 118 | 121 | if (!empty($post) |
| 119 | 122 | && (!empty($context['header']) |
@@ -142,18 +145,22 @@ discard block |
||
| 142 | 145 | endif; |
| 143 | 146 | |
| 144 | 147 | if ($IPP->errorCode() == 401 || // comment |
| 145 | - $IPP->errorCode() == 3200) /* long comment |
|
| 148 | + $IPP->errorCode() == 3200) { |
|
| 149 | + /* long comment |
|
| 146 | 150 | here |
| 147 | 151 | */ |
| 148 | 152 | { |
| 149 | 153 | return false; |
| 150 | 154 | } |
| 155 | +} |
|
| 151 | 156 | |
| 152 | 157 | if ($IPP->errorCode() == 401 || // comment |
| 153 | - $IPP->errorCode() == 3200) // long comment here |
|
| 158 | + $IPP->errorCode() == 3200) { |
|
| 159 | + // long comment here |
|
| 154 | 160 | { |
| 155 | 161 | return false; |
| 156 | 162 | } |
| 163 | +} |
|
| 157 | 164 | |
| 158 | 165 | if ($IPP->errorCode() == 401 |
| 159 | 166 | // Comment explaining the next condition here. |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | do { echo $i; } while ($i > 0); |
| 21 | 21 | |
| 22 | -do{ |
|
| 22 | +do { |
|
| 23 | 23 | echo $i; |
| 24 | -}while($i > 0); |
|
| 24 | +} while ($i > 0); |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | // while |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | echo $i; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -while($i < 1){ |
|
| 32 | +while ($i < 1) { |
|
| 33 | 33 | echo $i; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | echo $i; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -for($i = 1; $i < 1; $i++){ |
|
| 44 | +for ($i = 1; $i < 1; $i++) { |
|
| 45 | 45 | echo $i; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | echo $item; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -foreach($items as $item){ |
|
| 56 | +foreach ($items as $item) { |
|
| 57 | 57 | echo $item; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $i = 1; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | -if($i == 0){ |
|
| 68 | +if ($i == 0) { |
|
| 69 | 69 | $i = 1; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | if ($i == 0) { |
| 83 | 83 | $i = 1; |
| 84 | -}else{ |
|
| 84 | +} else { |
|
| 85 | 85 | $i = 0; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | if ($i == 0) { |
| 99 | 99 | $i = 1; |
| 100 | -}else{ |
|
| 100 | +} else { |
|
| 101 | 101 | $i = 0; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | if ($i == 0) { |
| 121 | 121 | $i = 1; |
| 122 | -}else if($i == 2){ |
|
| 122 | +} else if ($i == 2) { |
|
| 123 | 123 | $i = 0; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if ($i == 0) { |
| 127 | 127 | $i = 1; |
| 128 | -}elseif($i == 2){ |
|
| 128 | +}elseif ($i == 2) { |
|
| 129 | 129 | $i = 0; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | if ($i == 0) { |
| 83 | 83 | $i = 1; |
| 84 | -}else{ |
|
| 84 | +} else{ |
|
| 85 | 85 | $i = 0; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | if ($i == 0) { |
| 99 | 99 | $i = 1; |
| 100 | -}else{ |
|
| 100 | +} else{ |
|
| 101 | 101 | $i = 0; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | if ($i == 0) { |
| 121 | 121 | $i = 1; |
| 122 | -}else if($i == 2){ |
|
| 122 | +} else if($i == 2){ |
|
| 123 | 123 | $i = 0; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if ($i == 0) { |
| 127 | 127 | $i = 1; |
| 128 | -}elseif($i == 2){ |
|
| 128 | +} elseif($i == 2){ |
|
| 129 | 129 | $i = 0; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -153,7 +153,6 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if ($i == 0) { |
| 156 | -} |
|
| 157 | -else { |
|
| 156 | +} else { |
|
| 158 | 157 | } |
| 159 | 158 | ?> |
| 160 | 159 | \ No newline at end of file |
@@ -45,31 +45,31 @@ |
||
| 45 | 45 | public function getErrorList($testFile='MultiLineConditionUnitTest.inc') |
| 46 | 46 | { |
| 47 | 47 | $errors = array( |
| 48 | - 21 => 1, |
|
| 49 | - 22 => 1, |
|
| 50 | - 35 => 1, |
|
| 51 | - 40 => 1, |
|
| 52 | - 41 => 1, |
|
| 53 | - 42 => 1, |
|
| 54 | - 43 => 1, |
|
| 55 | - 49 => 1, |
|
| 56 | - 54 => 1, |
|
| 57 | - 57 => 1, |
|
| 58 | - 58 => 1, |
|
| 59 | - 59 => 1, |
|
| 60 | - 61 => 1, |
|
| 61 | - 67 => 1, |
|
| 62 | - 87 => 1, |
|
| 63 | - 88 => 1, |
|
| 64 | - 89 => 1, |
|
| 65 | - 90 => 1, |
|
| 66 | - 96 => 2, |
|
| 67 | - 101 => 1, |
|
| 68 | - 109 => 2, |
|
| 69 | - 125 => 1, |
|
| 70 | - 145 => 1, |
|
| 71 | - 153 => 1, |
|
| 72 | - ); |
|
| 48 | + 21 => 1, |
|
| 49 | + 22 => 1, |
|
| 50 | + 35 => 1, |
|
| 51 | + 40 => 1, |
|
| 52 | + 41 => 1, |
|
| 53 | + 42 => 1, |
|
| 54 | + 43 => 1, |
|
| 55 | + 49 => 1, |
|
| 56 | + 54 => 1, |
|
| 57 | + 57 => 1, |
|
| 58 | + 58 => 1, |
|
| 59 | + 59 => 1, |
|
| 60 | + 61 => 1, |
|
| 61 | + 67 => 1, |
|
| 62 | + 87 => 1, |
|
| 63 | + 88 => 1, |
|
| 64 | + 89 => 1, |
|
| 65 | + 90 => 1, |
|
| 66 | + 96 => 2, |
|
| 67 | + 101 => 1, |
|
| 68 | + 109 => 2, |
|
| 69 | + 125 => 1, |
|
| 70 | + 145 => 1, |
|
| 71 | + 153 => 1, |
|
| 72 | + ); |
|
| 73 | 73 | |
| 74 | 74 | if ($testFile === 'MultiLineConditionUnitTest.inc') { |
| 75 | 75 | $errors[167] = 1; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * |
| 43 | 43 | * @return array<int, int> |
| 44 | 44 | */ |
| 45 | - public function getErrorList($testFile='MultiLineConditionUnitTest.inc') |
|
| 45 | + public function getErrorList($testFile = 'MultiLineConditionUnitTest.inc') |
|
| 46 | 46 | { |
| 47 | 47 | $errors = array( |
| 48 | 48 | 21 => 1, |