@@ -57,7 +57,7 @@ |
||
| 57 | 57 | 48 => 1, |
| 58 | 58 | 70 => 1, |
| 59 | 59 | 71 => 1, |
| 60 | - ); |
|
| 60 | + ); |
|
| 61 | 61 | |
| 62 | 62 | }//end getErrorList() |
| 63 | 63 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Returns an array of tokens this test wants to listen for. |
| 22 | 22 | * |
| 23 | - * @return array |
|
| 23 | + * @return integer[] |
|
| 24 | 24 | */ |
| 25 | 25 | public function register() |
| 26 | 26 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * Processes this test, when one of its tokens is encountered. |
| 37 | 37 | * |
| 38 | - * @param PHP_CodeSniffer_File $phpcsFile The current file being processed. |
|
| 38 | + * @param File $phpcsFile The current file being processed. |
|
| 39 | 39 | * @param int $stackPtr The position of the current token in the |
| 40 | 40 | * stack passed in $tokens. |
| 41 | 41 | * |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | T_CLASS, |
| 50 | 50 | T_INTERFACE, |
| 51 | 51 | T_TRAIT, |
| 52 | - ); |
|
| 52 | + ); |
|
| 53 | 53 | |
| 54 | 54 | }//end register() |
| 55 | 55 | |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | if ($braceLine > ($classLine + 1)) { |
| 100 | 100 | $error = 'Opening brace of a %s must be on the line following the %s declaration; found %s line(s)'; |
| 101 | 101 | $data = array( |
| 102 | - $tokens[$stackPtr]['content'], |
|
| 103 | - $tokens[$stackPtr]['content'], |
|
| 104 | - ($braceLine - $classLine - 1), |
|
| 105 | - ); |
|
| 102 | + $tokens[$stackPtr]['content'], |
|
| 103 | + $tokens[$stackPtr]['content'], |
|
| 104 | + ($braceLine - $classLine - 1), |
|
| 105 | + ); |
|
| 106 | 106 | $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWrongLine', $data); |
| 107 | 107 | if ($fix === true) { |
| 108 | 108 | $phpcsFile->fixer->beginChangeset(); |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | if ($spaces !== $expected) { |
| 143 | 143 | $error = 'Expected %s spaces before opening brace; %s found'; |
| 144 | 144 | $data = array( |
| 145 | - $expected, |
|
| 146 | - $spaces, |
|
| 147 | - ); |
|
| 145 | + $expected, |
|
| 146 | + $spaces, |
|
| 147 | + ); |
|
| 148 | 148 | |
| 149 | 149 | $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'SpaceBeforeBrace', $data); |
| 150 | 150 | if ($fix === true) { |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | $tokens[$stackPtr]['content'], |
| 104 | 104 | ($braceLine - $classLine - 1), |
| 105 | 105 | ); |
| 106 | - $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWrongLine', $data); |
|
| 106 | + $fix = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWrongLine', $data); |
|
| 107 | 107 | if ($fix === true) { |
| 108 | 108 | $phpcsFile->fixer->beginChangeset(); |
| 109 | 109 | for ($i = ($curlyBrace - 1); $i > $lastContent; $i--) { |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | 48 => 1, |
| 58 | 58 | 70 => 1, |
| 59 | 59 | 71 => 1, |
| 60 | - ); |
|
| 60 | + ); |
|
| 61 | 61 | |
| 62 | 62 | }//end getErrorList() |
| 63 | 63 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | 48 => 1, |
| 58 | 58 | 70 => 1, |
| 59 | 59 | 71 => 1, |
| 60 | - ); |
|
| 60 | + ); |
|
| 61 | 61 | |
| 62 | 62 | }//end getErrorList() |
| 63 | 63 | |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] |
| 3 | - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); |
|
| 3 | + = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); |
|
| 4 | 4 | |
| 5 | 5 | $GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] |
| 6 | - = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); |
|
| 6 | + = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); |
|
| 7 | 7 | |
| 8 | 8 | $GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = |
| 9 | 9 | $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); |
@@ -12,11 +12,11 @@ |
||
| 12 | 12 | = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('nr_xajax')); |
| 13 | 13 | $GLOBALS['TSFE']->additionalHeaderData[$this->strApplicationName] = 'boo' |
| 14 | 14 | |
| 15 | -$var='string'; |
|
| 15 | +$var = 'string'; |
|
| 16 | 16 | |
| 17 | 17 | function getInstalledStandards( |
| 18 | - $includeGeneric=false, |
|
| 19 | - $standardsDir='' |
|
| 18 | + $includeGeneric = false, |
|
| 19 | + $standardsDir = '' |
|
| 20 | 20 | ) { |
| 21 | 21 | } |
| 22 | 22 | ?> |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | 48 => 1, |
| 58 | 58 | 70 => 1, |
| 59 | 59 | 71 => 1, |
| 60 | - ); |
|
| 60 | + ); |
|
| 61 | 61 | |
| 62 | 62 | }//end getErrorList() |
| 63 | 63 | |
@@ -4,30 +4,30 @@ discard block |
||
| 4 | 4 | { |
| 5 | 5 | function __construct() |
| 6 | 6 | { |
| 7 | - $this->hello(); // error here |
|
| 7 | + $this->hello(); // error here |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | - function hello() // error here |
|
| 10 | + function hello() // error here |
|
| 11 | 11 | { // no error here as brackets can be put anywhere in the pear standard |
| 12 | 12 | echo 'hello'; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | function hello2() |
| 16 | 16 | { |
| 17 | - if (TRUE) { // error here |
|
| 17 | + if (TRUE) { // error here |
|
| 18 | 18 | echo 'hello'; // no error here as its more than 4 spaces. |
| 19 | 19 | } else { |
| 20 | 20 | echo 'bye'; // error here |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | while (TRUE) { |
| 24 | - echo 'hello'; // error here |
|
| 25 | - } |
|
| 24 | + echo 'hello'; // error here |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - do { // error here |
|
| 28 | - echo 'hello'; // error here |
|
| 29 | - } while (TRUE); |
|
| 30 | - } |
|
| 27 | + do { // error here |
|
| 28 | + echo 'hello'; // error here |
|
| 29 | + } while (TRUE); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | function hello3() |
| 33 | 33 | { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | - */ |
|
| 126 | + */ |
|
| 127 | 127 | |
| 128 | 128 | /* |
| 129 | 129 | This comment has a newline in it. |
@@ -136,14 +136,14 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // no errors below. |
| 138 | 138 | $array = array( |
| 139 | - 'this', |
|
| 140 | - 'that' => array( |
|
| 141 | - 'hello', |
|
| 142 | - 'hello again' => array( |
|
| 143 | - 'hello', |
|
| 144 | - ), |
|
| 139 | + 'this', |
|
| 140 | + 'that' => array( |
|
| 141 | + 'hello', |
|
| 142 | + 'hello again' => array( |
|
| 143 | + 'hello', |
|
| 144 | + ), |
|
| 145 | 145 | ), |
| 146 | - ); |
|
| 146 | + ); |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
@@ -221,8 +221,8 @@ discard block |
||
| 221 | 221 | { |
| 222 | 222 | /* taken from http://de3.php.net/manual/en/reserved.php */ |
| 223 | 223 | # $m[] = 'declare'; |
| 224 | - /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
| 225 | - # $m[] = 'declare'; |
|
| 224 | + /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
| 225 | + # $m[] = 'declare'; |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | foreach ($elements as $element) { |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | array_map( |
| 309 | 309 | function($x) |
| 310 | 310 | { |
| 311 | - return trim($x); |
|
| 311 | + return trim($x); |
|
| 312 | 312 | }, |
| 313 | 313 | $array |
| 314 | 314 | ); |
| 315 | 315 | \ No newline at end of file |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | function hello3() |
| 33 | 33 | { |
| 34 | 34 | switch ($hello) { |
| 35 | - case 'hello': |
|
| 36 | - break; |
|
| 35 | + case 'hello': |
|
| 36 | + break; |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
@@ -79,20 +79,20 @@ discard block |
||
| 79 | 79 | } else if (FALSE) { |
| 80 | 80 | foreach ($tokens as $token) { |
| 81 | 81 | switch ($token) { |
| 82 | - case '1': |
|
| 83 | - case '2': |
|
| 84 | - if (true) { |
|
| 85 | - if (false) { |
|
| 82 | + case '1': |
|
| 83 | + case '2': |
|
| 84 | + if (true) { |
|
| 86 | 85 | if (false) { |
| 87 | 86 | if (false) { |
| 88 | - echo 'hello'; |
|
| 87 | + if (false) { |
|
| 88 | + echo 'hello'; |
|
| 89 | + } |
|
| 89 | 90 | } |
| 90 | 91 | } |
| 91 | 92 | } |
| 92 | - } |
|
| 93 | - break; |
|
| 94 | - case '5': |
|
| 95 | 93 | break; |
| 94 | + case '5': |
|
| 95 | + break; |
|
| 96 | 96 | } |
| 97 | 97 | do { |
| 98 | 98 | while (true) { |
@@ -161,20 +161,20 @@ discard block |
||
| 161 | 161 | $last = count($ts) - 1; |
| 162 | 162 | |
| 163 | 163 | switch ($token) { |
| 164 | - case '(': |
|
| 164 | + case '(': |
|
| 165 | 165 | |
| 166 | - if ($last >= 3 && |
|
| 167 | - $ts[0]['token'] != T_CLASS && |
|
| 168 | - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
| 169 | - $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 166 | + if ($last >= 3 && |
|
| 167 | + $ts[0]['token'] != T_CLASS && |
|
| 168 | + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
| 169 | + $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 170 | 170 | |
| 171 | 171 | |
| 172 | - if (true) { |
|
| 173 | - echo 'hello'; |
|
| 172 | + if (true) { |
|
| 173 | + echo 'hello'; |
|
| 174 | + } |
|
| 174 | 175 | } |
| 175 | - } |
|
| 176 | - array_push($braces, $token); |
|
| 177 | - break; |
|
| 176 | + array_push($braces, $token); |
|
| 177 | + break; |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -256,19 +256,19 @@ discard block |
||
| 256 | 256 | switch ($foo) { |
| 257 | 257 | case 1: |
| 258 | 258 | switch ($bar) { |
| 259 | - default: |
|
| 260 | - echo $string{1}; |
|
| 259 | + default: |
|
| 260 | + echo $string{1}; |
|
| 261 | 261 | } |
| 262 | 262 | break; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | function temp($foo, $bar) { |
| 266 | 266 | switch ($foo) { |
| 267 | - case 1: |
|
| 268 | - switch ($bar) { |
|
| 269 | - default: |
|
| 270 | - return $foo; |
|
| 271 | - } |
|
| 267 | + case 1: |
|
| 268 | + switch ($bar) { |
|
| 269 | + default: |
|
| 270 | + return $foo; |
|
| 271 | + } |
|
| 272 | 272 | break; |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | if ($last >= 3 && |
| 167 | 167 | $ts[0]['token'] != T_CLASS && |
| 168 | 168 | $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
| 169 | - $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
| 169 | + $ts[$last - 3]['token'] == T_VARIABLE) { |
|
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | if (true) { |
@@ -61,8 +61,12 @@ |
||
| 61 | 61 | public function open() |
| 62 | 62 | { |
| 63 | 63 | // Some inline stuff that shouldn't error |
| 64 | - if (TRUE) echo 'hello'; |
|
| 65 | - foreach ($tokens as $token) echo $token; |
|
| 64 | + if (TRUE) { |
|
| 65 | + echo 'hello'; |
|
| 66 | + } |
|
| 67 | + foreach ($tokens as $token) { |
|
| 68 | + echo $token; |
|
| 69 | + } |
|
| 66 | 70 | } |
| 67 | 71 | |
| 68 | 72 | /** |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | function test1() |
| 10 | 10 | { |
| 11 | - } |
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | 13 | function test2() {} |
| 14 | 14 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | class Test2 |
| 23 | 23 | { |
| 24 | - } |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | public function test2() |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | switch ($foo) { |
| 49 | 49 | case 1: |
| 50 | 50 | switch ($bar) { |
| 51 | - default: |
|
| 52 | - if ($something) { |
|
| 53 | - echo $string{1}; |
|
| 54 | - } else if ($else) { |
|
| 55 | - switch ($else) { |
|
| 56 | - case 1: |
|
| 57 | - // Do something. |
|
| 58 | - break; |
|
| 59 | - default: |
|
| 60 | - // Do something. |
|
| 61 | - break; |
|
| 62 | - } |
|
| 51 | + default: |
|
| 52 | + if ($something) { |
|
| 53 | + echo $string{1}; |
|
| 54 | + } else if ($else) { |
|
| 55 | + switch ($else) { |
|
| 56 | + case 1: |
|
| 57 | + // Do something. |
|
| 58 | + break; |
|
| 59 | + default: |
|
| 60 | + // Do something. |
|
| 61 | + break; |
|
| 62 | + } |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | break; |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | switch ($httpResponseCode) { |
| 72 | - case 100: |
|
| 73 | - case 101: |
|
| 74 | - case 102: |
|
| 75 | - default: |
|
| 76 | - return 'Unknown'; |
|
| 72 | + case 100: |
|
| 73 | + case 101: |
|
| 74 | + case 102: |
|
| 75 | + default: |
|
| 76 | + return 'Unknown'; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | switch ($httpResponseCode) { |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | if (!class_exists($class_name)) { |
| 34 | 34 | echo $error; |
| 35 | 35 | } |
| 36 | - $this->{$property} =& new $class_name($this->db_index); |
|
| 37 | - $this->modules[$module] =& $this->{$property}; |
|
| 36 | + $this->{$property} = & new $class_name($this->db_index); |
|
| 37 | + $this->modules[$module] = & $this->{$property}; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | foreach ($elements as $element) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | return 'Unknown'; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | -switch($i) { |
|
| 88 | +switch ($i) { |
|
| 89 | 89 | case 1: {} |
| 90 | 90 | } |
| 91 | 91 | |
@@ -127,15 +127,15 @@ discard block |
||
| 127 | 127 | <?php endforeach ?> |
| 128 | 128 | </ul> |
| 129 | 129 | <?php |
| 130 | -switch ( $a ) { |
|
| 130 | +switch ($a) { |
|
| 131 | 131 | case 'foo': |
| 132 | 132 | do { |
| 133 | 133 | $a = 'b'; |
| 134 | - } while ( $a ); |
|
| 134 | + } while ($a); |
|
| 135 | 135 | return 5; |
| 136 | 136 | |
| 137 | 137 | case 'bar': |
| 138 | - foreach ( $a as $b ) { |
|
| 138 | + foreach ($a as $b) { |
|
| 139 | 139 | $e = 'b'; |
| 140 | 140 | } |
| 141 | 141 | return 5; |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | 48 => 1, |
| 58 | 58 | 70 => 1, |
| 59 | 59 | 71 => 1, |
| 60 | - ); |
|
| 60 | + ); |
|
| 61 | 61 | |
| 62 | 62 | }//end getErrorList() |
| 63 | 63 | |