@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * Returns an array of tokens this test wants to listen for. |
34 | 34 | * |
35 | - * @return array |
|
35 | + * @return string[] |
|
36 | 36 | */ |
37 | 37 | public function register() |
38 | 38 | { |
@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * Returns an array of tokens this test wants to listen for. |
34 | 34 | * |
35 | - * @return array |
|
35 | + * @return integer[] |
|
36 | 36 | */ |
37 | 37 | public function register() |
38 | 38 | { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | return array( |
40 | 40 | T_STRING, |
41 | 41 | T_VARIABLE, |
42 | - ); |
|
42 | + ); |
|
43 | 43 | |
44 | 44 | }//end register() |
45 | 45 | |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | |
96 | 96 | $nextSeparator = $openBracket; |
97 | 97 | $find = array( |
98 | - T_VARIABLE, |
|
99 | - T_OPEN_SHORT_ARRAY, |
|
100 | - ); |
|
98 | + T_VARIABLE, |
|
99 | + T_OPEN_SHORT_ARRAY, |
|
100 | + ); |
|
101 | 101 | |
102 | 102 | while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { |
103 | 103 | if (isset($tokens[$nextSeparator]['nested_parenthesis']) === false) { |
@@ -50,7 +50,7 @@ |
||
50 | 50 | /** |
51 | 51 | * Returns an array of tokens this test wants to listen for. |
52 | 52 | * |
53 | - * @return array |
|
53 | + * @return integer[] |
|
54 | 54 | */ |
55 | 55 | public function register() |
56 | 56 | { |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | |
86 | 86 | // Predicate nodes for PHP. |
87 | 87 | $find = array( |
88 | - T_CASE => true, |
|
89 | - T_DEFAULT => true, |
|
90 | - T_CATCH => true, |
|
91 | - T_IF => true, |
|
92 | - T_FOR => true, |
|
93 | - T_FOREACH => true, |
|
94 | - T_WHILE => true, |
|
95 | - T_DO => true, |
|
96 | - T_ELSEIF => true, |
|
88 | + T_CASE => true, |
|
89 | + T_DEFAULT => true, |
|
90 | + T_CATCH => true, |
|
91 | + T_IF => true, |
|
92 | + T_FOR => true, |
|
93 | + T_FOREACH => true, |
|
94 | + T_WHILE => true, |
|
95 | + T_DO => true, |
|
96 | + T_ELSEIF => true, |
|
97 | 97 | ); |
98 | 98 | |
99 | 99 | $complexity = 1; |
@@ -108,16 +108,16 @@ discard block |
||
108 | 108 | if ($complexity > $this->absoluteComplexity) { |
109 | 109 | $error = 'Function\'s cyclomatic complexity (%s) exceeds allowed maximum of %s'; |
110 | 110 | $data = array( |
111 | - $complexity, |
|
112 | - $this->absoluteComplexity, |
|
113 | - ); |
|
111 | + $complexity, |
|
112 | + $this->absoluteComplexity, |
|
113 | + ); |
|
114 | 114 | $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data); |
115 | 115 | } else if ($complexity > $this->complexity) { |
116 | 116 | $warning = 'Function\'s cyclomatic complexity (%s) exceeds %s; consider refactoring the function'; |
117 | 117 | $data = array( |
118 | 118 | $complexity, |
119 | 119 | $this->complexity, |
120 | - ); |
|
120 | + ); |
|
121 | 121 | $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data); |
122 | 122 | } |
123 | 123 |
@@ -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 | { |
@@ -46,7 +46,7 @@ |
||
46 | 46 | /** |
47 | 47 | * Returns an array of tokens this test wants to listen for. |
48 | 48 | * |
49 | - * @return array |
|
49 | + * @return integer[] |
|
50 | 50 | */ |
51 | 51 | public function register() |
52 | 52 | { |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | * @var array |
39 | 39 | */ |
40 | 40 | protected $properties = array( |
41 | - 'svn:keywords' => 'Author Id Revision', |
|
42 | - 'svn:eol-style' => 'native', |
|
41 | + 'svn:keywords' => 'Author Id Revision', |
|
42 | + 'svn:eol-style' => 'native', |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | ) { |
90 | 90 | $error = 'Unexpected Subversion property "%s" = "%s"'; |
91 | 91 | $data = array( |
92 | - $key, |
|
93 | - $properties[$key], |
|
94 | - ); |
|
92 | + $key, |
|
93 | + $properties[$key], |
|
94 | + ); |
|
95 | 95 | $phpcsFile->addError($error, $stackPtr, 'Unexpected', $data); |
96 | 96 | continue; |
97 | 97 | } |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | ) { |
102 | 102 | $error = 'Missing Subversion property "%s" = "%s"'; |
103 | 103 | $data = array( |
104 | - $key, |
|
105 | - $this->properties[$key], |
|
106 | - ); |
|
104 | + $key, |
|
105 | + $this->properties[$key], |
|
106 | + ); |
|
107 | 107 | $phpcsFile->addError($error, $stackPtr, 'Missing', $data); |
108 | 108 | continue; |
109 | 109 | } |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | ) { |
114 | 114 | $error = 'Subversion property "%s" = "%s" does not match "%s"'; |
115 | 115 | $data = array( |
116 | - $key, |
|
117 | - $properties[$key], |
|
118 | - $this->properties[$key], |
|
119 | - ); |
|
116 | + $key, |
|
117 | + $properties[$key], |
|
118 | + $this->properties[$key], |
|
119 | + ); |
|
120 | 120 | $phpcsFile->addError($error, $stackPtr, 'NoMatch', $data); |
121 | 121 | } |
122 | 122 | }//end foreach |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * Returns an array of tokens this test wants to listen for. |
52 | 52 | * |
53 | - * @return array |
|
53 | + * @return integer[] |
|
54 | 54 | */ |
55 | 55 | public function register() |
56 | 56 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @param int $stackPtr The position of the current token in |
67 | 67 | * the stack passed in $tokens. |
68 | 68 | * |
69 | - * @return void |
|
69 | + * @return integer |
|
70 | 70 | */ |
71 | 71 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
72 | 72 | { |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | * @var array |
35 | 35 | */ |
36 | 36 | public $supportedTokenizers = array( |
37 | - 'PHP', |
|
38 | - 'JS', |
|
39 | - 'CSS', |
|
40 | - ); |
|
37 | + 'PHP', |
|
38 | + 'JS', |
|
39 | + 'CSS', |
|
40 | + ); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * The --tab-width CLI value that is being used. |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | T_WHITESPACE => true, |
87 | 87 | T_INLINE_HTML => true, |
88 | 88 | T_DOC_COMMENT_WHITESPACE => true, |
89 | - ); |
|
89 | + ); |
|
90 | 90 | |
91 | 91 | $tokens = $phpcsFile->getTokens(); |
92 | 92 | for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | /** |
118 | 118 | * Returns an array of tokens this test wants to listen for. |
119 | 119 | * |
120 | - * @return array |
|
120 | + * @return integer[] |
|
121 | 121 | */ |
122 | 122 | public function register() |
123 | 123 | { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @param int $stackPtr The position of the current token |
138 | 138 | * in the stack passed in $tokens. |
139 | 139 | * |
140 | - * @return void |
|
140 | + * @return integer |
|
141 | 141 | */ |
142 | 142 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
143 | 143 | { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @var array |
39 | 39 | */ |
40 | 40 | public $supportedTokenizers = array( |
41 | - 'PHP', |
|
42 | - 'JS', |
|
43 | - ); |
|
41 | + 'PHP', |
|
42 | + 'JS', |
|
43 | + ); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * The number of spaces code should be indented. |
@@ -810,15 +810,15 @@ discard block |
||
810 | 810 | if ($this->tabIndent === true) { |
811 | 811 | $error .= '%s tabs, found %s'; |
812 | 812 | $data = array( |
813 | - floor($checkIndent / $this->_tabWidth), |
|
814 | - floor($tokenIndent / $this->_tabWidth), |
|
815 | - ); |
|
813 | + floor($checkIndent / $this->_tabWidth), |
|
814 | + floor($tokenIndent / $this->_tabWidth), |
|
815 | + ); |
|
816 | 816 | } else { |
817 | 817 | $error .= '%s spaces, found %s'; |
818 | 818 | $data = array( |
819 | - $checkIndent, |
|
820 | - $tokenIndent, |
|
821 | - ); |
|
819 | + $checkIndent, |
|
820 | + $tokenIndent, |
|
821 | + ); |
|
822 | 822 | } |
823 | 823 | |
824 | 824 | if ($this->_debug === true) { |
@@ -34,7 +34,7 @@ |
||
34 | 34 | /** |
35 | 35 | * Should this test be skipped for some reason. |
36 | 36 | * |
37 | - * @return void |
|
37 | + * @return boolean |
|
38 | 38 | */ |
39 | 39 | protected function shouldSkipTest() |
40 | 40 | { |
@@ -60,7 +60,7 @@ |
||
60 | 60 | { |
61 | 61 | return array( |
62 | 62 | 3 => 1, |
63 | - ); |
|
63 | + ); |
|
64 | 64 | |
65 | 65 | }//end getErrorList() |
66 | 66 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | * |
37 | 37 | * @param string $testFile The name of the file being tested. |
38 | 38 | * |
39 | - * @return array |
|
39 | + * @return string[] |
|
40 | 40 | */ |
41 | 41 | public function getCliValues($testFile) |
42 | 42 | { |
@@ -79,20 +79,20 @@ |
||
79 | 79 | 46 => 1, |
80 | 80 | 47 => 1, |
81 | 81 | 48 => 1, |
82 | - ); |
|
82 | + ); |
|
83 | 83 | break; |
84 | 84 | case 'DisallowTabIndentUnitTest.js': |
85 | 85 | return array( |
86 | 86 | 3 => 1, |
87 | 87 | 5 => 1, |
88 | 88 | 6 => 1, |
89 | - ); |
|
89 | + ); |
|
90 | 90 | break; |
91 | 91 | case 'DisallowTabIndentUnitTest.css': |
92 | 92 | return array( |
93 | 93 | 1 => 1, |
94 | 94 | 2 => 1, |
95 | - ); |
|
95 | + ); |
|
96 | 96 | break; |
97 | 97 | default: |
98 | 98 | return array(); |
@@ -58,45 +58,45 @@ |
||
58 | 58 | public function getErrorList($testFile='DisallowTabIndentUnitTest.inc') |
59 | 59 | { |
60 | 60 | switch ($testFile) { |
61 | - case 'DisallowTabIndentUnitTest.inc': |
|
62 | - return array( |
|
63 | - 5 => 2, |
|
64 | - 9 => 1, |
|
65 | - 15 => 1, |
|
66 | - 20 => 2, |
|
67 | - 21 => 1, |
|
68 | - 22 => 2, |
|
69 | - 23 => 1, |
|
70 | - 24 => 2, |
|
71 | - 31 => 1, |
|
72 | - 32 => 2, |
|
73 | - 33 => 2, |
|
74 | - 41 => 1, |
|
75 | - 42 => 1, |
|
76 | - 43 => 1, |
|
77 | - 44 => 1, |
|
78 | - 45 => 1, |
|
79 | - 46 => 1, |
|
80 | - 47 => 1, |
|
81 | - 48 => 1, |
|
82 | - ); |
|
83 | - break; |
|
84 | - case 'DisallowTabIndentUnitTest.js': |
|
85 | - return array( |
|
86 | - 3 => 1, |
|
87 | - 5 => 1, |
|
88 | - 6 => 1, |
|
89 | - ); |
|
90 | - break; |
|
91 | - case 'DisallowTabIndentUnitTest.css': |
|
92 | - return array( |
|
93 | - 1 => 1, |
|
94 | - 2 => 1, |
|
95 | - ); |
|
96 | - break; |
|
97 | - default: |
|
98 | - return array(); |
|
99 | - break; |
|
61 | + case 'DisallowTabIndentUnitTest.inc': |
|
62 | + return array( |
|
63 | + 5 => 2, |
|
64 | + 9 => 1, |
|
65 | + 15 => 1, |
|
66 | + 20 => 2, |
|
67 | + 21 => 1, |
|
68 | + 22 => 2, |
|
69 | + 23 => 1, |
|
70 | + 24 => 2, |
|
71 | + 31 => 1, |
|
72 | + 32 => 2, |
|
73 | + 33 => 2, |
|
74 | + 41 => 1, |
|
75 | + 42 => 1, |
|
76 | + 43 => 1, |
|
77 | + 44 => 1, |
|
78 | + 45 => 1, |
|
79 | + 46 => 1, |
|
80 | + 47 => 1, |
|
81 | + 48 => 1, |
|
82 | + ); |
|
83 | + break; |
|
84 | + case 'DisallowTabIndentUnitTest.js': |
|
85 | + return array( |
|
86 | + 3 => 1, |
|
87 | + 5 => 1, |
|
88 | + 6 => 1, |
|
89 | + ); |
|
90 | + break; |
|
91 | + case 'DisallowTabIndentUnitTest.css': |
|
92 | + return array( |
|
93 | + 1 => 1, |
|
94 | + 2 => 1, |
|
95 | + ); |
|
96 | + break; |
|
97 | + default: |
|
98 | + return array(); |
|
99 | + break; |
|
100 | 100 | }//end switch |
101 | 101 | |
102 | 102 | }//end getErrorList() |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * |
56 | 56 | * @return array<int, int> |
57 | 57 | */ |
58 | - public function getErrorList($testFile='DisallowTabIndentUnitTest.inc') |
|
58 | + public function getErrorList($testFile = 'DisallowTabIndentUnitTest.inc') |
|
59 | 59 | { |
60 | 60 | switch ($testFile) { |
61 | 61 | case 'DisallowTabIndentUnitTest.inc': |