@@ -55,7 +55,7 @@ |
||
| 55 | 55 | * @param array $tokens The stack of tokens that make up |
| 56 | 56 | * the file. |
| 57 | 57 | * |
| 58 | - * @return void |
|
| 58 | + * @return boolean |
|
| 59 | 59 | */ |
| 60 | 60 | public function isMultiLineDeclaration(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens) |
| 61 | 61 | { |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | * @var array |
| 40 | 40 | */ |
| 41 | 41 | public $supportedTokenizers = array( |
| 42 | - 'PHP', |
|
| 43 | - 'JS', |
|
| 44 | - ); |
|
| 42 | + 'PHP', |
|
| 43 | + 'JS', |
|
| 44 | + ); |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -165,7 +165,7 @@ |
||
| 165 | 165 | * |
| 166 | 166 | * @return void |
| 167 | 167 | */ |
| 168 | - public function processBracket(PHP_CodeSniffer_File $phpcsFile, $openBracket, $tokens, $type='function') |
|
| 168 | + public function processBracket(PHP_CodeSniffer_File $phpcsFile, $openBracket, $tokens, $type = 'function') |
|
| 169 | 169 | { |
| 170 | 170 | $errorPrefix = ''; |
| 171 | 171 | if ($type === 'use') { |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | /** |
| 38 | 38 | * Returns an array of tokens this test wants to listen for. |
| 39 | 39 | * |
| 40 | - * @return array |
|
| 40 | + * @return string[] |
|
| 41 | 41 | */ |
| 42 | 42 | public function register() |
| 43 | 43 | { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * Registers the token types that this sniff wishes to listen to. |
| 41 | 41 | * |
| 42 | - * @return array |
|
| 42 | + * @return string[] |
|
| 43 | 43 | */ |
| 44 | 44 | public function register() |
| 45 | 45 | { |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | /** |
| 35 | 35 | * Returns an array of tokens this test wants to listen for. |
| 36 | 36 | * |
| 37 | - * @return array |
|
| 37 | + * @return integer[] |
|
| 38 | 38 | */ |
| 39 | 39 | public function register() |
| 40 | 40 | { |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | if ($contentColumn !== $indent) { |
| 168 | 168 | $error = 'First line of embedded PHP code must be indented %s spaces; %s found'; |
| 169 | 169 | $data = array( |
| 170 | - $indent, |
|
| 171 | - $contentColumn, |
|
| 172 | - ); |
|
| 170 | + $indent, |
|
| 171 | + $contentColumn, |
|
| 172 | + ); |
|
| 173 | 173 | $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); |
| 174 | 174 | if ($fix === true) { |
| 175 | 175 | $padding = str_repeat(' ', $indent); |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | if ($found > $expected) { |
| 226 | 226 | $error = 'Opening PHP tag indent incorrect; expected no more than %s spaces but found %s'; |
| 227 | 227 | $data = array( |
| 228 | - $expected, |
|
| 229 | - $found, |
|
| 230 | - ); |
|
| 228 | + $expected, |
|
| 229 | + $found, |
|
| 230 | + ); |
|
| 231 | 231 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); |
| 232 | 232 | if ($fix === true) { |
| 233 | 233 | $phpcsFile->fixer->replaceToken(($stackPtr - 1), str_repeat(' ', $expected)); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $indent, |
| 171 | 171 | $contentColumn, |
| 172 | 172 | ); |
| 173 | - $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); |
|
| 173 | + $fix = $phpcsFile->addFixableError($error, $firstContent, 'Indent', $data); |
|
| 174 | 174 | if ($fix === true) { |
| 175 | 175 | $padding = str_repeat(' ', $indent); |
| 176 | 176 | if ($contentColumn === 0) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $expected, |
| 229 | 229 | $found, |
| 230 | 230 | ); |
| 231 | - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); |
|
| 231 | + $fix = $phpcsFile->addFixableError($error, $stackPtr, 'OpenTagIndent', $data); |
|
| 232 | 232 | if ($fix === true) { |
| 233 | 233 | $phpcsFile->fixer->replaceToken(($stackPtr - 1), str_repeat(' ', $expected)); |
| 234 | 234 | } |
@@ -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 | { |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | /** |
| 45 | 45 | * Returns an array of tokens this test wants to listen for. |
| 46 | 46 | * |
| 47 | - * @return array |
|
| 47 | + * @return integer[] |
|
| 48 | 48 | */ |
| 49 | 49 | public function register() |
| 50 | 50 | { |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | 38 | public $supportedTokenizers = array( |
| 39 | - 'PHP', |
|
| 40 | - 'JS', |
|
| 41 | - ); |
|
| 39 | + 'PHP', |
|
| 40 | + 'JS', |
|
| 41 | + ); |
|
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | T_ELSEIF, |
| 60 | 60 | T_TRY, |
| 61 | 61 | T_CATCH, |
| 62 | - ); |
|
| 62 | + ); |
|
| 63 | 63 | |
| 64 | 64 | }//end register() |
| 65 | 65 | |
@@ -138,12 +138,12 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | // We ignore spacing for some structures that tend to have their own rules. |
| 140 | 140 | $ignore = array( |
| 141 | - T_FUNCTION => true, |
|
| 142 | - T_CLASS => true, |
|
| 143 | - T_INTERFACE => true, |
|
| 144 | - T_TRAIT => true, |
|
| 145 | - T_DOC_COMMENT_OPEN_TAG => true, |
|
| 146 | - ); |
|
| 141 | + T_FUNCTION => true, |
|
| 142 | + T_CLASS => true, |
|
| 143 | + T_INTERFACE => true, |
|
| 144 | + T_TRAIT => true, |
|
| 145 | + T_DOC_COMMENT_OPEN_TAG => true, |
|
| 146 | + ); |
|
| 147 | 147 | |
| 148 | 148 | if (isset($ignore[$tokens[$firstContent]['code']]) === false |
| 149 | 149 | && $tokens[$firstContent]['line'] >= ($tokens[$scopeOpener]['line'] + 2) |
@@ -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 | { |
@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $error .= ' after function; %s found'; |
| 111 | 111 | $data = array( |
| 112 | - $this->spacing, |
|
| 113 | - $foundLines, |
|
| 114 | - ); |
|
| 112 | + $this->spacing, |
|
| 113 | + $foundLines, |
|
| 114 | + ); |
|
| 115 | 115 | |
| 116 | 116 | $fix = $phpcsFile->addFixableError($error, $closer, 'After', $data); |
| 117 | 117 | if ($fix === true) { |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | $error .= ' before function; %s found'; |
| 204 | 204 | $data = array( |
| 205 | - $this->spacing, |
|
| 206 | - $foundLines, |
|
| 207 | - ); |
|
| 205 | + $this->spacing, |
|
| 206 | + $foundLines, |
|
| 207 | + ); |
|
| 208 | 208 | |
| 209 | 209 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Before', $data); |
| 210 | 210 | if ($fix === true) { |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | /** |
| 45 | 45 | * Returns an array of tokens this test wants to listen for. |
| 46 | 46 | * |
| 47 | - * @return array |
|
| 47 | + * @return string[] |
|
| 48 | 48 | */ |
| 49 | 49 | public function register() |
| 50 | 50 | { |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | 38 | public $supportedTokenizers = array( |
| 39 | - 'PHP', |
|
| 40 | - 'JS', |
|
| 41 | - ); |
|
| 39 | + 'PHP', |
|
| 40 | + 'JS', |
|
| 41 | + ); |
|
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).';'; |
| 82 | 82 | $error = 'Space found before semicolon; expected "%s" but found "%s"'; |
| 83 | 83 | $data = array( |
| 84 | - $expected, |
|
| 85 | - $found, |
|
| 84 | + $expected, |
|
| 85 | + $found, |
|
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | 88 | $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data); |
@@ -61,9 +61,6 @@ |
||
| 61 | 61 | * - three |
| 62 | 62 | * |
| 63 | 63 | * @param array &$tokens The array of tokens to process. |
| 64 | - * @param object $tokenizer The tokenizer being used to |
|
| 65 | - * process this file. |
|
| 66 | - * @param string $eolChar The EOL character to use for splitting strings. |
|
| 67 | 64 | * |
| 68 | 65 | * @return void |
| 69 | 66 | */ |
@@ -14,29 +14,29 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | - * Some info about the class here |
|
| 18 | - * |
|
| 19 | - */ |
|
| 17 | + * Some info about the class here |
|
| 18 | + * |
|
| 19 | + */ |
|
| 20 | 20 | class MyClass |
| 21 | 21 | { |
| 22 | 22 | /** |
| 23 | - *Some info about the function here. |
|
| 24 | - * |
|
| 25 | - * @return void |
|
| 26 | - */ |
|
| 23 | + *Some info about the function here. |
|
| 24 | + * |
|
| 25 | + * @return void |
|
| 26 | + */ |
|
| 27 | 27 | function myFunction() {} |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Some info about the class here |
| 32 | - * |
|
| 32 | + * |
|
| 33 | 33 | */ |
| 34 | 34 | class MyClass |
| 35 | 35 | { |
| 36 | 36 | /** |
| 37 | 37 | * Some info about the function here. |
| 38 | - * |
|
| 39 | - * @return void |
|
| 38 | + * |
|
| 39 | + * @return void |
|
| 40 | 40 | */ |
| 41 | 41 | function myFunction() {} |
| 42 | 42 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | echo 'hi'; |
| 50 | 50 | /** |
| 51 | 51 | Comment here. |
| 52 | - */ |
|
| 52 | + */ |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |