@@ -187,7 +187,7 @@ |
||
| 187 | 187 | * @param array $tokens The stack of tokens that make up |
| 188 | 188 | * the file. |
| 189 | 189 | * |
| 190 | - * @return void |
|
| 190 | + * @return boolean |
|
| 191 | 191 | */ |
| 192 | 192 | public function isMultiLineDeclaration(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens) |
| 193 | 193 | { |
@@ -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 | * Returns an array of tokens this test wants to listen for. |
| 37 | 37 | * |
| 38 | - * @return array |
|
| 38 | + * @return integer[] |
|
| 39 | 39 | */ |
| 40 | 40 | public function register() |
| 41 | 41 | { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | return array( |
| 43 | 43 | T_CLASS, |
| 44 | 44 | T_INTERFACE, |
| 45 | - ); |
|
| 45 | + ); |
|
| 46 | 46 | |
| 47 | 47 | }//end register() |
| 48 | 48 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * Returns an array of tokens this test wants to listen for. |
| 41 | 41 | * |
| 42 | - * @return array |
|
| 42 | + * @return integer[] |
|
| 43 | 43 | */ |
| 44 | 44 | public function register() |
| 45 | 45 | { |
@@ -87,8 +87,8 @@ |
||
| 87 | 87 | $expected = strtolower($tokens[$nextCase]['content']); |
| 88 | 88 | $error = strtoupper($type).' keyword must be lowercase; expected "%s" but found "%s"'; |
| 89 | 89 | $data = array( |
| 90 | - $expected, |
|
| 91 | - $tokens[$nextCase]['content'], |
|
| 90 | + $expected, |
|
| 91 | + $tokens[$nextCase]['content'], |
|
| 92 | 92 | ); |
| 93 | 93 | |
| 94 | 94 | $fix = $phpcsFile->addFixableError($error, $nextCase, $type.'NotLower', $data); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Returns an array of tokens this test wants to listen for. |
| 34 | 34 | * |
| 35 | - * @return array |
|
| 35 | + * @return integer[] |
|
| 36 | 36 | */ |
| 37 | 37 | public function register() |
| 38 | 38 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param int $stackPtr The position of the current token in |
| 49 | 49 | * the stack passed in $tokens. |
| 50 | 50 | * |
| 51 | - * @return void |
|
| 51 | + * @return integer |
|
| 52 | 52 | */ |
| 53 | 53 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
| 54 | 54 | { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Returns an array of tokens this test wants to listen for. |
| 34 | 34 | * |
| 35 | - * @return array |
|
| 35 | + * @return integer[] |
|
| 36 | 36 | */ |
| 37 | 37 | public function register() |
| 38 | 38 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param int $stackPtr The position of the current token in |
| 49 | 49 | * the stack passed in $tokens. |
| 50 | 50 | * |
| 51 | - * @return void |
|
| 51 | + * @return integer |
|
| 52 | 52 | */ |
| 53 | 53 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
| 54 | 54 | { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Returns an array of tokens this test wants to listen for. |
| 34 | 34 | * |
| 35 | - * @return array |
|
| 35 | + * @return integer[] |
|
| 36 | 36 | */ |
| 37 | 37 | public function register() |
| 38 | 38 | { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | * @param int $stackPtr The position of the current token in |
| 146 | 146 | * the stack passed in $tokens. |
| 147 | 147 | * |
| 148 | - * @return void |
|
| 148 | + * @return boolean |
|
| 149 | 149 | */ |
| 150 | 150 | private function _shouldIgnoreUse(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
| 151 | 151 | { |
@@ -89,8 +89,6 @@ |
||
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | -use Vendor\Test\FooBar; |
|
| 93 | - |
|
| 94 | 92 | function test() |
| 95 | 93 | { |
| 96 | 94 | switch ($val) { |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | switch ($foo) { |
| 37 | - case'Foo': { |
|
| 38 | - echo 'foo'; |
|
| 39 | - break; |
|
| 40 | - } |
|
| 37 | + case'Foo': { |
|
| 38 | + echo 'foo'; |
|
| 39 | + break; |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | while ($i < 10) { |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | switch (true) { |
| 55 | - case is_resource($value): |
|
| 56 | - throw new Exception('foo'); |
|
| 57 | - case is_object($value): |
|
| 58 | - return 'object'; |
|
| 55 | + case is_resource($value): |
|
| 56 | + throw new Exception('foo'); |
|
| 57 | + case is_object($value): |
|
| 58 | + return 'object'; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | switch (0) { |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | switch ($foo) { |
| 108 | - case 1: $bar = 1; break; |
|
| 109 | - case 2: |
|
| 108 | + case 1: $bar = 1; break; |
|
| 109 | + case 2: |
|
| 110 | 110 | |
| 111 | - $bar = 2; break; |
|
| 112 | - case 21: |
|
| 113 | - case 3: return 3; |
|
| 114 | - default: $bar = 0; |
|
| 111 | + $bar = 2; break; |
|
| 112 | + case 21: |
|
| 113 | + case 3: return 3; |
|
| 114 | + default: $bar = 0; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | switch ($foo) { |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | break; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | -switch($foo) |
|
| 138 | +switch ($foo) |
|
| 139 | 139 | { |
| 140 | 140 | case ('foo'): |
| 141 | 141 | default: |
@@ -1,15 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace MyProject; |
| 3 | 3 | |
| 4 | -use BarClass as Bar; |
|
| 5 | -use My\Full\Classname as Another; |
|
| 6 | - |
|
| 7 | - |
|
| 8 | -use Something; |
|
| 9 | -use SomethingElse; |
|
| 10 | - |
|
| 11 | 4 | // Comment here. |
| 12 | -use LastThing; |
|
| 13 | 5 | |
| 14 | 6 | class Foo { |
| 15 | 7 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $var = new MyClass( |
| 18 | - function () use ($foo, $bar) { |
|
| 18 | + function() use ($foo, $bar) { |
|
| 19 | 19 | return true; |
| 20 | 20 | } |
| 21 | 21 | ); |
@@ -1,14 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace MyProject; |
| 3 | 3 | |
| 4 | -use BarClass as Bar; |
|
| 5 | -use My\Full\Classname as Another, My\Full\NSname; |
|
| 6 | - |
|
| 7 | 4 | |
| 8 | 5 | namespace AnotherProject; |
| 9 | 6 | |
| 10 | -use ArrayObject; |
|
| 11 | - |
|
| 12 | 7 | |
| 13 | 8 | $foo = 'bar'; |
| 14 | 9 | |