Completed
Pull Request — master (#7)
by Tomáš
09:48 queued 03:17
created
src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      * @var array
36 36
      */
37 37
     public $supportedTokenizers = array(
38
-                                   'PHP',
39
-                                   'JS',
40
-                                  );
38
+                                    'PHP',
39
+                                    'JS',
40
+                                    );
41 41
 
42 42
     /**
43 43
      * If true, an error will be thrown; otherwise a warning.
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         return array(
68 68
                 T_STRING_CONCAT,
69 69
                 T_PLUS,
70
-               );
70
+                );
71 71
 
72 72
     }//end register()
73 73
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
     /**
63 63
      * Processes this sniff, when one of its tokens is encountered.
64 64
      *
65
-     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
65
+     * @param File $phpcsFile The file being scanned.
66 66
      * @param int                  $stackPtr  The position of the current token in the
67 67
      *                                        stack passed in $tokens.
68 68
      *
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,9 +93,9 @@
 block discarded – undo
93 93
         ) {
94 94
             $error = 'Closing brace indented incorrectly; expected %s spaces, found %s';
95 95
             $data  = array(
96
-                      ($startColumn - 1),
97
-                      ($braceIndent - 1),
98
-                     );
96
+                        ($startColumn - 1),
97
+                        ($braceIndent - 1),
98
+                        );
99 99
 
100 100
             $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'Indent', $data);
101 101
             if ($fix === true) {
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
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
      * Allow newlines instead of spaces.
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
         $operators  = PHP_CodeSniffer_Tokens::$operators;
60 60
         $assignment = PHP_CodeSniffer_Tokens::$assignmentTokens;
61 61
         $inlineIf   = array(
62
-                       T_INLINE_THEN,
63
-                       T_INLINE_ELSE,
64
-                      );
62
+                        T_INLINE_THEN,
63
+                        T_INLINE_ELSE,
64
+                        );
65 65
 
66 66
         return array_unique(
67 67
             array_merge($comparison, $operators, $assignment, $inlineIf)
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
             // A list of tokens that indicate that the token is not
220 220
             // part of an arithmetic operation.
221 221
             $invalidTokens = array(
222
-                              T_COMMA               => true,
223
-                              T_OPEN_PARENTHESIS    => true,
224
-                              T_OPEN_SQUARE_BRACKET => true,
225
-                              T_OPEN_SHORT_ARRAY    => true,
226
-                              T_DOUBLE_ARROW        => true,
227
-                              T_COLON               => true,
228
-                              T_INLINE_THEN         => true,
229
-                              T_INLINE_ELSE         => true,
230
-                              T_CASE                => true,
231
-                             );
222
+                                T_COMMA               => true,
223
+                                T_OPEN_PARENTHESIS    => true,
224
+                                T_OPEN_SQUARE_BRACKET => true,
225
+                                T_OPEN_SHORT_ARRAY    => true,
226
+                                T_DOUBLE_ARROW        => true,
227
+                                T_COLON               => true,
228
+                                T_INLINE_THEN         => true,
229
+                                T_INLINE_ELSE         => true,
230
+                                T_CASE                => true,
231
+                                );
232 232
 
233 233
             if (isset($invalidTokens[$tokens[$prev]['code']]) === true) {
234 234
                 // Just trying to use a negative value; eg. myFunction($var, -2).
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
             ) {
262 262
                 $error = 'Expected 1 space before "%s"; %s found';
263 263
                 $data  = array(
264
-                          $operator,
265
-                          $found,
266
-                         );
264
+                            $operator,
265
+                            $found,
266
+                            );
267 267
                 $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data);
268 268
                 if ($fix === true) {
269 269
                     $phpcsFile->fixer->beginChangeset();
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
             ) {
309 309
                 $error = 'Expected 1 space after "%s"; %s found';
310 310
                 $data  = array(
311
-                          $operator,
312
-                          $found,
313
-                         );
311
+                            $operator,
312
+                            $found,
313
+                            );
314 314
                 $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfter', $data);
315 315
                 if ($fix === true) {
316 316
                     $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' ');
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                           $operator,
265 265
                           $found,
266 266
                          );
267
-                $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data);
267
+                $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data);
268 268
                 if ($fix === true) {
269 269
                     $phpcsFile->fixer->beginChangeset();
270 270
                     if ($found === 'newline') {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                           $operator,
312 312
                           $found,
313 313
                          );
314
-                $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfter', $data);
314
+                $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfter', $data);
315 315
                 if ($fix === true) {
316 316
                     $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' ');
317 317
                 }
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
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
     /**
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         return array(
52 52
                 T_FUNCTION,
53 53
                 T_CLOSURE,
54
-               );
54
+                );
55 55
 
56 56
     }//end register()
57 57
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         $nextContent = $phpcsFile->findNext(T_WHITESPACE, ($openBrace + 1), null, true);
79 79
 
80 80
         if ($nextContent === $tokens[$stackPtr]['scope_closer']) {
81
-             // The next bit of content is the closing brace, so this
82
-             // is an empty function and should have a blank line
83
-             // between the opening and closing braces.
81
+                // The next bit of content is the closing brace, so this
82
+                // is an empty function and should have a blank line
83
+                // between the opening and closing braces.
84 84
             return;
85 85
         }
86 86
 
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 T_REQUIRE,
49 49
                 T_REQUIRE_ONCE,
50 50
                 T_NEW,
51
-               );
51
+                );
52 52
 
53 53
     }//end register()
54 54
 
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
         } else {
86 86
             $error = 'Language constructs must be followed by a single space; expected "%s" but found "%s"';
87 87
             $data  = array(
88
-                      $tokens[$stackPtr]['content'].' '.$tokens[($stackPtr + 1)]['content'],
89
-                      $tokens[$stackPtr]['content'].$tokens[($stackPtr + 1)]['content'],
90
-                     );
88
+                        $tokens[$stackPtr]['content'].' '.$tokens[($stackPtr + 1)]['content'],
89
+                        $tokens[$stackPtr]['content'].$tokens[($stackPtr + 1)]['content'],
90
+                        );
91 91
             $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data);
92 92
             if ($fix === true) {
93 93
                 $phpcsFile->fixer->addContent($stackPtr, ' ');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
                       $tokens[$stackPtr]['content'].' '.$tokens[($stackPtr + 1)]['content'],
89 89
                       $tokens[$stackPtr]['content'].$tokens[($stackPtr + 1)]['content'],
90 90
                      );
91
-            $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data);
91
+            $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data);
92 92
             if ($fix === true) {
93 93
                 $phpcsFile->fixer->addContent($stackPtr, ' ');
94 94
             }
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     /**
27 27
      * Returns an array of tokens this test wants to listen for.
28 28
      *
29
-     * @return array
29
+     * @return integer[]
30 30
      */
31 31
     public function register()
32 32
     {
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     /**
39 39
      * Processes this sniff when one of its tokens is encountered.
40 40
      *
41
-     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
41
+     * @param File $phpcsFile The file being scanned.
42 42
      * @param int                  $stackPtr  The position of the current token
43 43
      *                                        in the stack passed in $tokens.
44 44
      *
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@
 block discarded – undo
63 63
         if ($content !== $expected) {
64 64
             $error = 'Cast statements must not contain whitespace; expected "%s" but found "%s"';
65 65
             $data  = array(
66
-                      $expected,
67
-                      $content,
68
-                     );
66
+                        $expected,
67
+                        $content,
68
+                        );
69 69
 
70 70
             $fix = $phpcsFile->addFixableError($error, $stackPtr, 'ContainsWhiteSpace', $data);
71 71
             if ($fix === true) {
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
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
     /**
@@ -76,18 +76,18 @@  discard block
 block discarded – undo
76 76
 
77 77
         $nextToken = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true);
78 78
         $ignore    = array(
79
-                      T_CLASS     => true,
80
-                      T_INTERFACE => true,
81
-                      T_FUNCTION  => true,
82
-                      T_PUBLIC    => true,
83
-                      T_PRIVATE   => true,
84
-                      T_PROTECTED => true,
85
-                      T_STATIC    => true,
86
-                      T_ABSTRACT  => true,
87
-                      T_PROPERTY  => true,
88
-                      T_OBJECT    => true,
89
-                      T_PROTOTYPE => true,
90
-                     );
79
+                        T_CLASS     => true,
80
+                        T_INTERFACE => true,
81
+                        T_FUNCTION  => true,
82
+                        T_PUBLIC    => true,
83
+                        T_PRIVATE   => true,
84
+                        T_PROTECTED => true,
85
+                        T_STATIC    => true,
86
+                        T_ABSTRACT  => true,
87
+                        T_PROPERTY  => true,
88
+                        T_OBJECT    => true,
89
+                        T_PROTOTYPE => true,
90
+                        );
91 91
 
92 92
         if (isset($ignore[$tokens[$nextToken]['code']]) === false) {
93 93
             // Could be a file comment.
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
             if ($tokens[$i]['column'] !== $requiredColumn) {
120 120
                 $error = 'Expected %s space(s) before asterisk; %s found';
121 121
                 $data  = array(
122
-                          ($requiredColumn - 1),
123
-                          ($tokens[$i]['column'] - 1),
124
-                         );
122
+                            ($requiredColumn - 1),
123
+                            ($tokens[$i]['column'] - 1),
124
+                            );
125 125
                 $fix   = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data);
126 126
                 if ($fix === true) {
127 127
                     $padding = str_repeat(' ', ($requiredColumn - 1));
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
                           ($requiredColumn - 1),
123 123
                           ($tokens[$i]['column'] - 1),
124 124
                          );
125
-                $fix   = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data);
125
+                $fix = $phpcsFile->addFixableError($error, $i, 'SpaceBeforeStar', $data);
126 126
                 if ($fix === true) {
127 127
                     $padding = str_repeat(' ', ($requiredColumn - 1));
128 128
                     if ($tokens[$i]['column'] === 1) {
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     /**
31 31
      * Returns an array of tokens this test wants to listen for.
32 32
      *
33
-     * @return array
33
+     * @return string[]
34 34
      */
35 35
     public function register()
36 36
     {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     /**
43 43
      * Processes this test, when one of its tokens is encountered.
44 44
      *
45
-     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
45
+     * @param File $phpcsFile The file being scanned.
46 46
      * @param int                  $stackPtr  The position of the current token
47 47
      *                                        in the stack passed in $tokens.
48 48
      *
Please login to merge, or discard this patch.