Completed
Pull Request — master (#7)
by Tomáš
09:48 queued 03:17
created
src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php 3 patches
Indentation   +33 added lines, -33 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_COMMENT,
53 53
                 T_DOC_COMMENT_OPEN_TAG,
54
-               );
54
+                );
55 55
 
56 56
     }//end register()
57 57
 
@@ -81,24 +81,24 @@  discard block
 block discarded – undo
81 81
             );
82 82
 
83 83
             $ignore = array(
84
-                       T_CLASS,
85
-                       T_INTERFACE,
86
-                       T_TRAIT,
87
-                       T_FUNCTION,
88
-                       T_CLOSURE,
89
-                       T_PUBLIC,
90
-                       T_PRIVATE,
91
-                       T_PROTECTED,
92
-                       T_FINAL,
93
-                       T_STATIC,
94
-                       T_ABSTRACT,
95
-                       T_CONST,
96
-                       T_PROPERTY,
97
-                       T_INCLUDE,
98
-                       T_INCLUDE_ONCE,
99
-                       T_REQUIRE,
100
-                       T_REQUIRE_ONCE,
101
-                      );
84
+                        T_CLASS,
85
+                        T_INTERFACE,
86
+                        T_TRAIT,
87
+                        T_FUNCTION,
88
+                        T_CLOSURE,
89
+                        T_PUBLIC,
90
+                        T_PRIVATE,
91
+                        T_PROTECTED,
92
+                        T_FINAL,
93
+                        T_STATIC,
94
+                        T_ABSTRACT,
95
+                        T_CONST,
96
+                        T_PROPERTY,
97
+                        T_INCLUDE,
98
+                        T_INCLUDE_ONCE,
99
+                        T_REQUIRE,
100
+                        T_REQUIRE_ONCE,
101
+                        );
102 102
 
103 103
             if (in_array($tokens[$nextToken]['code'], $ignore) === true) {
104 104
                 return;
@@ -195,24 +195,24 @@  discard block
 block discarded – undo
195 195
             if ($tabFound === true) {
196 196
                 $error = 'Tab found before comment text; expected "// %s" but found "%s"';
197 197
                 $data  = array(
198
-                          ltrim(substr($comment, 2)),
199
-                          $comment,
200
-                         );
198
+                            ltrim(substr($comment, 2)),
199
+                            $comment,
200
+                            );
201 201
                 $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'TabBefore', $data);
202 202
             } else if ($spaceCount === 0) {
203 203
                 $error = 'No space found before comment text; expected "// %s" but found "%s"';
204 204
                 $data  = array(
205
-                          substr($comment, 2),
206
-                          $comment,
207
-                         );
205
+                            substr($comment, 2),
206
+                            $comment,
207
+                            );
208 208
                 $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore', $data);
209 209
             } else if ($spaceCount > 1) {
210 210
                 $error = 'Expected 1 space before comment text but found %s; use block comment if you need indentation';
211 211
                 $data  = array(
212
-                          $spaceCount,
213
-                          substr($comment, (2 + $spaceCount)),
214
-                          $comment,
215
-                         );
212
+                            $spaceCount,
213
+                            substr($comment, (2 + $spaceCount)),
214
+                            $comment,
215
+                            );
216 216
                 $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data);
217 217
             }//end if
218 218
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                                 'full-stops'        => '.',
275 275
                                 'exclamation marks' => '!',
276 276
                                 'or question marks' => '?',
277
-                               );
277
+                                );
278 278
 
279 279
             if (in_array($commentCloser, $acceptedClosers) === false) {
280 280
                 $error = 'Inline comments must end in %s';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@
 block discarded – undo
213 213
                           substr($comment, (2 + $spaceCount)),
214 214
                           $comment,
215 215
                          );
216
-                $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data);
216
+                $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data);
217 217
             }//end if
218 218
 
219 219
             if ($fix === true) {
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/Commenting/VariableCommentSniff.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $tokens       = $phpcsFile->getTokens();
49 49
         $commentToken = array(
50
-                         T_COMMENT,
51
-                         T_DOC_COMMENT_CLOSE_TAG,
50
+                            T_COMMENT,
51
+                            T_DOC_COMMENT_CLOSE_TAG,
52 52
                         );
53 53
 
54 54
         $commentEnd = $phpcsFile->findPrevious($commentToken, $stackPtr);
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
         if ($varType !== $suggestedType) {
124 124
             $error = 'Expected "%s" but found "%s" for @var tag in member variable comment';
125 125
             $data  = array(
126
-                      $suggestedType,
127
-                      $varType,
128
-                     );
126
+                        $suggestedType,
127
+                        $varType,
128
+                        );
129 129
             $phpcsFile->addError($error, ($foundVar + 2), 'IncorrectVarType', $data);
130 130
         }
131 131
 
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
                 48 => 1,
58 58
                 70 => 1,
59 59
                 71 => 1,
60
-               );
60
+                );
61 61
 
62 62
     }//end getErrorList()
63 63
 
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/Commenting/BlockCommentSniff.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         return array(
42 42
                 T_COMMENT,
43 43
                 T_DOC_COMMENT_OPEN_TAG,
44
-               );
44
+                );
45 45
 
46 46
     }//end register()
47 47
 
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
         if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) {
70 70
             $nextToken = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);
71 71
             $ignore    = array(
72
-                          T_CLASS     => true,
73
-                          T_INTERFACE => true,
74
-                          T_TRAIT     => true,
75
-                          T_FUNCTION  => true,
76
-                          T_PUBLIC    => true,
77
-                          T_PRIVATE   => true,
78
-                          T_FINAL     => true,
79
-                          T_PROTECTED => true,
80
-                          T_STATIC    => true,
81
-                          T_ABSTRACT  => true,
82
-                          T_CONST     => true,
83
-                          T_VAR       => true,
84
-                         );
72
+                            T_CLASS     => true,
73
+                            T_INTERFACE => true,
74
+                            T_TRAIT     => true,
75
+                            T_FUNCTION  => true,
76
+                            T_PUBLIC    => true,
77
+                            T_PRIVATE   => true,
78
+                            T_FINAL     => true,
79
+                            T_PROTECTED => true,
80
+                            T_STATIC    => true,
81
+                            T_ABSTRACT  => true,
82
+                            T_CONST     => true,
83
+                            T_VAR       => true,
84
+                            );
85 85
             if (isset($ignore[$tokens[$nextToken]['code']]) === true) {
86 86
                 return;
87 87
             }
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
                 }
203 203
 
204 204
                 $data = array(
205
-                         $expected,
206
-                         $leadingSpace,
205
+                            $expected,
206
+                            $leadingSpace,
207 207
                         );
208 208
 
209 209
                 $error = 'First line of comment not aligned correctly; expected %s but found %s';
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
                 }
246 246
 
247 247
                 $data = array(
248
-                         $expected,
249
-                         $leadingSpace,
248
+                            $expected,
249
+                            $leadingSpace,
250 250
                         );
251 251
 
252 252
                 $error = 'Comment line indented incorrectly; expected at least %s but found %s';
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
                 }
278 278
 
279 279
                 $data = array(
280
-                         $expected,
281
-                         $leadingSpace,
280
+                            $expected,
281
+                            $leadingSpace,
282 282
                         );
283 283
 
284 284
                 $error = 'Last line of comment aligned incorrectly; expected %s but found %s';
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 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
      * The openers that we are interested in.
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                                 T_WHILE,
52 52
                                 T_TRY,
53 53
                                 T_CASE,
54
-                               );
54
+                                );
55 55
 
56 56
     /**
57 57
      * The length that a code block must be before
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
             $found = trim($tokens[$comment]['content']);
191 191
             $error = 'Incorrect closing comment; expected "%s" but found "%s"';
192 192
             $data  = array(
193
-                      $expected,
194
-                      $found,
195
-                     );
193
+                        $expected,
194
+                        $found,
195
+                        );
196 196
 
197 197
             $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Invalid', $data);
198 198
             if ($fix === true) {
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.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/Functions/LowercaseFunctionKeywordsSniff.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                 T_PRIVATE,
45 45
                 T_PROTECTED,
46 46
                 T_STATIC,
47
-               );
47
+                );
48 48
 
49 49
     }//end register()
50 50
 
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
         if ($content !== strtolower($content)) {
67 67
             $error = '%s keyword must be lowercase; expected "%s" but found "%s"';
68 68
             $data  = array(
69
-                      strtoupper($content),
70
-                      strtolower($content),
71
-                      $content,
72
-                     );
69
+                        strtoupper($content),
70
+                        strtolower($content),
71
+                        $content,
72
+                        );
73 73
             $phpcsFile->addError($error, $stackPtr, 'FoundUppercase', $data);
74 74
         }
75 75
 
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
                 48 => 1,
58 58
                 70 => 1,
59 59
                 71 => 1,
60
-               );
60
+                );
61 61
 
62 62
     }//end getErrorList()
63 63
 
Please login to merge, or discard this patch.
src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
      * @var array
33 33
      */
34 34
     public $supportedTokenizers = array(
35
-                                   'PHP',
36
-                                   'JS',
37
-                                  );
35
+                                    'PHP',
36
+                                    'JS',
37
+                                    );
38 38
 
39 39
 
40 40
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 T_ELSE,
56 56
                 T_ELSEIF,
57 57
                 T_SWITCH,
58
-               );
58
+                );
59 59
 
60 60
     }//end register()
61 61
 
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
         if ($found !== 1) {
93 93
             $error = 'Expected 1 space after %s keyword; %s found';
94 94
             $data  = array(
95
-                      strtoupper($tokens[$stackPtr]['content']),
96
-                      $found,
97
-                     );
95
+                        strtoupper($tokens[$stackPtr]['content']),
96
+                        $found,
97
+                        );
98 98
 
99 99
             $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterKeyword', $data);
100 100
             if ($fix === true) {
Please login to merge, or discard this patch.