Completed
Pull Request — master (#30)
by Bill
04:36 queued 02:46
created
src/Codor/Sniffs/Classes/ClassLengthSniff.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function register()
23 23
     {
24
-        return [T_CLASS];
24
+        return [ T_CLASS ];
25 25
     }
26 26
 
27 27
     /**
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
     public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
36 36
     {
37 37
         $tokens = $phpcsFile->getTokens();
38
-        $token = $tokens[$stackPtr];
38
+        $token = $tokens[ $stackPtr ];
39 39
         
40
-        $openParenthesis = $tokens[$token['scope_opener']];
41
-        $closedParenthesis = $tokens[$token['scope_closer']];
40
+        $openParenthesis = $tokens[ $token[ 'scope_opener' ] ];
41
+        $closedParenthesis = $tokens[ $token[ 'scope_closer' ] ];
42 42
 
43
-        $classLength = $closedParenthesis['line'] - $openParenthesis['line'];
43
+        $classLength = $closedParenthesis[ 'line' ] - $openParenthesis[ 'line' ];
44 44
 
45 45
         if ($classLength > $this->maxLength) {
46 46
             $phpcsFile->addError("Class is {$classLength} lines. Must be {$this->maxLength} lines or fewer.", $stackPtr);
Please login to merge, or discard this patch.