Completed
Push — master ( a8a2d5...a3abb9 )
by Bill
10s
created
src/Codor/Sniffs/ControlStructures/NoElseSniff.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 {
13 13
     public function register()
14 14
     {
15
-        return [T_ELSE, T_ELSEIF];
15
+        return [ T_ELSE, T_ELSEIF ];
16 16
     }
17 17
 
18 18
     /**
Please login to merge, or discard this patch.
src/Codor/Sniffs/Files/FunctionLengthSniff.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,25 +12,25 @@
 block discarded – undo
12 12
 
13 13
     public function register()
14 14
     {
15
-        return [T_FUNCTION];
15
+        return [ T_FUNCTION ];
16 16
     }
17 17
 
18 18
     public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
19 19
     {
20 20
         $tokens = $phpcsFile->getTokens();
21
-        $token = $tokens[$stackPtr];
21
+        $token = $tokens[ $stackPtr ];
22 22
 
23 23
         // Skip function without body.
24
-        if (isset($token['scope_opener']) === false) {
24
+        if (isset($token[ 'scope_opener' ]) === false) {
25 25
             return 0;
26 26
         }
27 27
 
28
-        $firstToken = $tokens[$token['scope_opener']];
29
-        $lastToken = $tokens[$token['scope_closer']];
30
-        $length = $lastToken['line'] - $firstToken['line'];
28
+        $firstToken = $tokens[ $token[ 'scope_opener' ] ];
29
+        $lastToken = $tokens[ $token[ 'scope_closer' ] ];
30
+        $length = $lastToken[ 'line' ] - $firstToken[ 'line' ];
31 31
 
32 32
         if ($length > $this->maxLength) {
33
-            $tokenType = strtolower(substr($token['type'], 2));
33
+            $tokenType = strtolower(substr($token[ 'type' ], 2));
34 34
             $error = "Function is {$length} lines. Must be {$this->maxLength} lines or fewer.";
35 35
             $phpcsFile->addError($error, $stackPtr, sprintf('%sTooBig', ucfirst($tokenType)));
36 36
         }
Please login to merge, or discard this patch.
src/Codor/Sniffs/Files/FunctionParameterSniff.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function register()
22 22
     {
23
-        return [T_FUNCTION];
23
+        return [ T_FUNCTION ];
24 24
     }
25 25
 
26 26
     /**
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
     public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
35 35
     {
36 36
         $tokens = $phpcsFile->getTokens();
37
-        $token = $tokens[$stackPtr];
37
+        $token = $tokens[ $stackPtr ];
38 38
 
39 39
         // Skip function without body.
40
-        if (isset($token['scope_opener']) === false) {
40
+        if (isset($token[ 'scope_opener' ]) === false) {
41 41
             return;
42 42
         }
43 43
 
44
-        $openParenIndex = $token['parenthesis_opener'];
45
-        $closedParenIndex = $token['parenthesis_closer'];
44
+        $openParenIndex = $token[ 'parenthesis_opener' ];
45
+        $closedParenIndex = $token[ 'parenthesis_closer' ];
46 46
 
47 47
         $numberOfParameters = 0;
48
-        for ($index=$openParenIndex+1; $index <= $closedParenIndex; $index++) {
49
-            if ($tokens[$index]['type'] == 'T_VARIABLE') {
48
+        for ($index = $openParenIndex + 1; $index <= $closedParenIndex; $index++) {
49
+            if ($tokens[ $index ][ 'type' ] == 'T_VARIABLE') {
50 50
                 $numberOfParameters++;
51 51
             }
52 52
         }
Please login to merge, or discard this patch.
src/Codor/Sniffs/Files/ReturnNullSniff.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      */
15 15
     public function register()
16 16
     {
17
-        return [T_RETURN];
17
+        return [ T_RETURN ];
18 18
     }
19 19
 
20 20
     /**
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 
33 33
         $returnValueToken = '';
34 34
         for ($index = $returnTokenIndex; $index < count($tokens); $index++) { 
35
-            if ($tokens[$index]['type'] === 'T_SEMICOLON') {
36
-                $returnValueToken = $tokens[$index - 1];
35
+            if ($tokens[ $index ][ 'type' ] === 'T_SEMICOLON') {
36
+                $returnValueToken = $tokens[ $index - 1 ];
37 37
                 break;
38 38
             }
39 39
         }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             return;
43 43
         }
44 44
 
45
-        if ($returnValueToken['type'] === 'T_NULL') {
45
+        if ($returnValueToken[ 'type' ] === 'T_NULL') {
46 46
             $error = "Return null value found.";
47 47
             $phpcsFile->addError($error, $stackPtr);
48 48
         }
Please login to merge, or discard this patch.