@@ -76,10 +76,10 @@ |
||
76 | 76 | $end = --$token['parenthesis_closer']; |
77 | 77 | |
78 | 78 | $parts = array( |
79 | - 0, |
|
80 | - 0, |
|
81 | - 0, |
|
82 | - ); |
|
79 | + 0, |
|
80 | + 0, |
|
81 | + 0, |
|
82 | + ); |
|
83 | 83 | $index = 0; |
84 | 84 | |
85 | 85 | for (; $next <= $end; ++$next) { |
@@ -110,7 +110,7 @@ |
||
110 | 110 | $data = array( |
111 | 111 | $code, |
112 | 112 | $error, |
113 | - ); |
|
113 | + ); |
|
114 | 114 | if (in_array($code, $this->errorCodes) === true) { |
115 | 115 | $phpcsFile->addErrorOnLine($message, $line, 'ExternalToolError', $data); |
116 | 116 | } else { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Returns the token types that this sniff is interested in. |
29 | 29 | * |
30 | - * @return int[] |
|
30 | + * @return integer[] |
|
31 | 31 | */ |
32 | 32 | public function register() |
33 | 33 | { |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Processes the tokens that this sniff is interested in. |
41 | 41 | * |
42 | - * @param PHP_CodeSniffer_File $phpcsFile The file where the token was found. |
|
42 | + * @param File $phpcsFile The file where the token was found. |
|
43 | 43 | * @param int $stackPtr The position in the stack where |
44 | 44 | * the token was found. |
45 | 45 | * |
46 | - * @return void |
|
46 | + * @return null|integer |
|
47 | 47 | * @throws PHP_CodeSniffer_Exception If jslint.js could not be run |
48 | 48 | */ |
49 | 49 | public function process(File $phpcsFile, $stackPtr) |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | |
62 | 62 | $namespace = ''; |
63 | 63 | $findTokens = array( |
64 | - T_CLASS, |
|
65 | - T_INTERFACE, |
|
66 | - T_NAMESPACE, |
|
67 | - T_CLOSE_TAG, |
|
68 | - ); |
|
64 | + T_CLASS, |
|
65 | + T_INTERFACE, |
|
66 | + T_NAMESPACE, |
|
67 | + T_CLOSE_TAG, |
|
68 | + ); |
|
69 | 69 | |
70 | 70 | $stackPtr = $phpcsFile->findNext($findTokens, ($stackPtr + 1)); |
71 | 71 | while ($stackPtr !== false) { |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | if ($tokens[$stackPtr]['code'] === T_NAMESPACE) { |
80 | 80 | $nsEnd = $phpcsFile->findNext( |
81 | 81 | array( |
82 | - T_NS_SEPARATOR, |
|
83 | - T_STRING, |
|
84 | - T_WHITESPACE, |
|
82 | + T_NS_SEPARATOR, |
|
83 | + T_STRING, |
|
84 | + T_WHITESPACE, |
|
85 | 85 | ), |
86 | 86 | ($stackPtr + 1), |
87 | 87 | null, |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | $line = $this->foundClasses[$compareName]['line']; |
105 | 105 | $error = 'Duplicate %s name "%s" found; first defined in %s on line %s'; |
106 | 106 | $data = array( |
107 | - $type, |
|
108 | - $name, |
|
109 | - $file, |
|
110 | - $line, |
|
111 | - ); |
|
107 | + $type, |
|
108 | + $name, |
|
109 | + $file, |
|
110 | + $line, |
|
111 | + ); |
|
112 | 112 | $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); |
113 | 113 | } else { |
114 | 114 | $this->foundClasses[$compareName] = array( |
115 | - 'file' => $phpcsFile->getFilename(), |
|
116 | - 'line' => $tokens[$stackPtr]['line'], |
|
115 | + 'file' => $phpcsFile->getFilename(), |
|
116 | + 'line' => $tokens[$stackPtr]['line'], |
|
117 | 117 | ); |
118 | 118 | } |
119 | 119 | }//end if |
@@ -57,7 +57,7 @@ |
||
57 | 57 | 48 => 1, |
58 | 58 | 70 => 1, |
59 | 59 | 71 => 1, |
60 | - ); |
|
60 | + ); |
|
61 | 61 | |
62 | 62 | }//end getErrorList() |
63 | 63 |
@@ -28,15 +28,15 @@ |
||
28 | 28 | public function getErrorList($testFile='') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'InlineHTMLUnitTest.3.inc': |
|
32 | - return array(4 => 1); |
|
33 | - break; |
|
34 | - case 'InlineHTMLUnitTest.4.inc': |
|
35 | - return array(1 => 1); |
|
36 | - break; |
|
37 | - default: |
|
38 | - return array(); |
|
39 | - break; |
|
31 | + case 'InlineHTMLUnitTest.3.inc': |
|
32 | + return array(4 => 1); |
|
33 | + break; |
|
34 | + case 'InlineHTMLUnitTest.4.inc': |
|
35 | + return array(1 => 1); |
|
36 | + break; |
|
37 | + default: |
|
38 | + return array(); |
|
39 | + break; |
|
40 | 40 | }//end switch |
41 | 41 | |
42 | 42 | }//end getErrorList() |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='') |
|
43 | + public function getErrorList($testFile = '') |
|
44 | 44 | { |
45 | 45 | switch ($testFile) { |
46 | 46 | case 'EndFileNoNewlineUnitTest.1.inc': |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @return array<int, int> |
77 | 77 | */ |
78 | - public function getWarningList($testFile='') |
|
78 | + public function getWarningList($testFile = '') |
|
79 | 79 | { |
80 | 80 | return array(); |
81 | 81 |
@@ -28,14 +28,14 @@ |
||
28 | 28 | public function getErrorList($testFile='') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'EndFileNewlineUnitTest.3.inc': |
|
32 | - case 'EndFileNewlineUnitTest.3.js': |
|
33 | - case 'EndFileNewlineUnitTest.3.css': |
|
34 | - return array(2 => 1); |
|
35 | - break; |
|
36 | - default: |
|
37 | - return array(); |
|
38 | - break; |
|
31 | + case 'EndFileNewlineUnitTest.3.inc': |
|
32 | + case 'EndFileNewlineUnitTest.3.js': |
|
33 | + case 'EndFileNewlineUnitTest.3.css': |
|
34 | + return array(2 => 1); |
|
35 | + break; |
|
36 | + default: |
|
37 | + return array(); |
|
38 | + break; |
|
39 | 39 | }//end switch |
40 | 40 | |
41 | 41 | }//end getErrorList() |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='') |
|
43 | + public function getErrorList($testFile = '') |
|
44 | 44 | { |
45 | 45 | switch ($testFile) { |
46 | 46 | case 'EndFileNoNewlineUnitTest.1.inc': |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @return array<int, int> |
77 | 77 | */ |
78 | - public function getWarningList($testFile='') |
|
78 | + public function getWarningList($testFile = '') |
|
79 | 79 | { |
80 | 80 | return array(); |
81 | 81 |
@@ -28,19 +28,19 @@ |
||
28 | 28 | public function getErrorList($testFile='') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'EndFileNoNewlineUnitTest.1.inc': |
|
32 | - case 'EndFileNoNewlineUnitTest.1.css': |
|
33 | - case 'EndFileNoNewlineUnitTest.1.js': |
|
34 | - case 'EndFileNoNewlineUnitTest.2.inc': |
|
35 | - return array(3 => 1); |
|
36 | - break; |
|
37 | - case 'EndFileNoNewlineUnitTest.2.css': |
|
38 | - case 'EndFileNoNewlineUnitTest.2.js': |
|
39 | - return array(2 => 1); |
|
40 | - break; |
|
41 | - default: |
|
42 | - return array(); |
|
43 | - break; |
|
31 | + case 'EndFileNoNewlineUnitTest.1.inc': |
|
32 | + case 'EndFileNoNewlineUnitTest.1.css': |
|
33 | + case 'EndFileNoNewlineUnitTest.1.js': |
|
34 | + case 'EndFileNoNewlineUnitTest.2.inc': |
|
35 | + return array(3 => 1); |
|
36 | + break; |
|
37 | + case 'EndFileNoNewlineUnitTest.2.css': |
|
38 | + case 'EndFileNoNewlineUnitTest.2.js': |
|
39 | + return array(2 => 1); |
|
40 | + break; |
|
41 | + default: |
|
42 | + return array(); |
|
43 | + break; |
|
44 | 44 | }//end switch |
45 | 45 | |
46 | 46 | }//end getErrorList() |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='') |
|
43 | + public function getErrorList($testFile = '') |
|
44 | 44 | { |
45 | 45 | switch ($testFile) { |
46 | 46 | case 'EndFileNoNewlineUnitTest.1.inc': |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @return array<int, int> |
77 | 77 | */ |
78 | - public function getWarningList($testFile='') |
|
78 | + public function getWarningList($testFile = '') |
|
79 | 79 | { |
80 | 80 | return array(); |
81 | 81 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | 48 => 1, |
58 | 58 | 70 => 1, |
59 | 59 | 71 => 1, |
60 | - ); |
|
60 | + ); |
|
61 | 61 | |
62 | 62 | }//end getErrorList() |
63 | 63 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | return array( |
46 | 46 | 73 => 1, |
47 | - ); |
|
47 | + ); |
|
48 | 48 | |
49 | 49 | }//end getErrorList() |
50 | 50 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | return array( |
63 | 63 | 27 => 1, |
64 | 64 | 46 => 1, |
65 | - ); |
|
65 | + ); |
|
66 | 66 | |
67 | 67 | }//end getWarningList() |
68 | 68 |