@@ -27,16 +27,14 @@ discard block |
||
27 | 27 | * @package PHPCompatibility |
28 | 28 | * @author Juliette Reinders Folmer <[email protected]> |
29 | 29 | */ |
30 | -class NewDynamicAccessToStaticSniff extends Sniff |
|
31 | -{ |
|
30 | +class NewDynamicAccessToStaticSniff extends Sniff { |
|
32 | 31 | |
33 | 32 | /** |
34 | 33 | * Returns an array of tokens this test wants to listen for. |
35 | 34 | * |
36 | 35 | * @return array |
37 | 36 | */ |
38 | - public function register() |
|
39 | - { |
|
37 | + public function register() { |
|
40 | 38 | return array( |
41 | 39 | \T_DOUBLE_COLON, |
42 | 40 | ); |
@@ -51,8 +49,7 @@ discard block |
||
51 | 49 | * |
52 | 50 | * @return void |
53 | 51 | */ |
54 | - public function process(File $phpcsFile, $stackPtr) |
|
55 | - { |
|
52 | + public function process(File $phpcsFile, $stackPtr) { |
|
56 | 53 | if ($this->supportsBelow('5.2') === false) { |
57 | 54 | return; |
58 | 55 | } |
@@ -25,16 +25,14 @@ discard block |
||
25 | 25 | * @package PHPCompatibility |
26 | 26 | * @author Alex Miroshnikov <[email protected]> |
27 | 27 | */ |
28 | -class NewShortArraySniff extends Sniff |
|
29 | -{ |
|
28 | +class NewShortArraySniff extends Sniff { |
|
30 | 29 | |
31 | 30 | /** |
32 | 31 | * Returns an array of tokens this test wants to listen for. |
33 | 32 | * |
34 | 33 | * @return array |
35 | 34 | */ |
36 | - public function register() |
|
37 | - { |
|
35 | + public function register() { |
|
38 | 36 | return array( |
39 | 37 | \T_OPEN_SHORT_ARRAY, |
40 | 38 | \T_CLOSE_SHORT_ARRAY, |
@@ -51,8 +49,7 @@ discard block |
||
51 | 49 | * |
52 | 50 | * @return void |
53 | 51 | */ |
54 | - public function process(File $phpcsFile, $stackPtr) |
|
55 | - { |
|
52 | + public function process(File $phpcsFile, $stackPtr) { |
|
56 | 53 | if ($this->supportsBelow('5.3') === false) { |
57 | 54 | return; |
58 | 55 | } |
@@ -28,16 +28,14 @@ discard block |
||
28 | 28 | * @author Wim Godden <[email protected]> |
29 | 29 | * @copyright 2012 Cu.be Solutions bvba |
30 | 30 | */ |
31 | -class RemovedNewReferenceSniff extends Sniff |
|
32 | -{ |
|
31 | +class RemovedNewReferenceSniff extends Sniff { |
|
33 | 32 | |
34 | 33 | /** |
35 | 34 | * Returns an array of tokens this test wants to listen for. |
36 | 35 | * |
37 | 36 | * @return array |
38 | 37 | */ |
39 | - public function register() |
|
40 | - { |
|
38 | + public function register() { |
|
41 | 39 | return array(\T_NEW); |
42 | 40 | } |
43 | 41 | |
@@ -50,8 +48,7 @@ discard block |
||
50 | 48 | * |
51 | 49 | * @return void |
52 | 50 | */ |
53 | - public function process(File $phpcsFile, $stackPtr) |
|
54 | - { |
|
51 | + public function process(File $phpcsFile, $stackPtr) { |
|
55 | 52 | if ($this->supportsAbove('5.3') === false) { |
56 | 53 | return; |
57 | 54 | } |
@@ -24,15 +24,13 @@ discard block |
||
24 | 24 | * @package PHPCompatibility |
25 | 25 | * @author Juliette Reinders Folmer <[email protected]> |
26 | 26 | */ |
27 | -class NewFunctionCallTrailingCommaSniff extends Sniff |
|
28 | -{ |
|
27 | +class NewFunctionCallTrailingCommaSniff extends Sniff { |
|
29 | 28 | /** |
30 | 29 | * Returns an array of tokens this test wants to listen for. |
31 | 30 | * |
32 | 31 | * @return array |
33 | 32 | */ |
34 | - public function register() |
|
35 | - { |
|
33 | + public function register() { |
|
36 | 34 | return array( |
37 | 35 | \T_STRING, |
38 | 36 | \T_VARIABLE, |
@@ -51,8 +49,7 @@ discard block |
||
51 | 49 | * |
52 | 50 | * @return void |
53 | 51 | */ |
54 | - public function process(File $phpcsFile, $stackPtr) |
|
55 | - { |
|
52 | + public function process(File $phpcsFile, $stackPtr) { |
|
56 | 53 | if ($this->supportsBelow('7.2') === false) { |
57 | 54 | return; |
58 | 55 | } |
@@ -30,16 +30,14 @@ discard block |
||
30 | 30 | * @package PHPCompatibility |
31 | 31 | * @author Juliette Reinders Folmer <[email protected]> |
32 | 32 | */ |
33 | -class NewFlexibleHeredocNowdocSniff extends Sniff |
|
34 | -{ |
|
33 | +class NewFlexibleHeredocNowdocSniff extends Sniff { |
|
35 | 34 | |
36 | 35 | /** |
37 | 36 | * Returns an array of tokens this test wants to listen for. |
38 | 37 | * |
39 | 38 | * @return array |
40 | 39 | */ |
41 | - public function register() |
|
42 | - { |
|
40 | + public function register() { |
|
43 | 41 | $targets = array( |
44 | 42 | \T_END_HEREDOC, |
45 | 43 | \T_END_NOWDOC, |
@@ -63,8 +61,7 @@ discard block |
||
63 | 61 | * |
64 | 62 | * @return void |
65 | 63 | */ |
66 | - public function process(File $phpcsFile, $stackPtr) |
|
67 | - { |
|
64 | + public function process(File $phpcsFile, $stackPtr) { |
|
68 | 65 | /* |
69 | 66 | * Due to a tokenizer bug which gets hit when the PHP 7.3 heredoc/nowdoc syntax |
70 | 67 | * is used, this part of the sniff cannot possibly work on PHPCS < 2.6.0. |
@@ -90,8 +87,7 @@ discard block |
||
90 | 87 | * |
91 | 88 | * @return void |
92 | 89 | */ |
93 | - protected function detectIndentedNonStandAloneClosingMarker(File $phpcsFile, $stackPtr) |
|
94 | - { |
|
90 | + protected function detectIndentedNonStandAloneClosingMarker(File $phpcsFile, $stackPtr) { |
|
95 | 91 | $tokens = $phpcsFile->getTokens(); |
96 | 92 | $indentError = 'Heredoc/nowdoc with an indented closing marker is not supported in PHP 7.2 or earlier.'; |
97 | 93 | $indentErrorCode = 'IndentedClosingMarker'; |
@@ -177,8 +173,7 @@ discard block |
||
177 | 173 | * |
178 | 174 | * @return void |
179 | 175 | */ |
180 | - protected function detectClosingMarkerInBody(File $phpcsFile, $stackPtr) |
|
181 | - { |
|
176 | + protected function detectClosingMarkerInBody(File $phpcsFile, $stackPtr) { |
|
182 | 177 | $tokens = $phpcsFile->getTokens(); |
183 | 178 | $error = 'The body of a heredoc/nowdoc can not contain the heredoc/nowdoc closing marker as text at the start of a line since PHP 7.3.'; |
184 | 179 | $errorCode = 'ClosingMarkerNoNewLine'; |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | * @author Florian Grandel <[email protected]> |
31 | 31 | * @copyright 2009 Florian Grandel |
32 | 32 | */ |
33 | -class ForbiddenCallTimePassByReferenceSniff extends Sniff |
|
34 | -{ |
|
33 | +class ForbiddenCallTimePassByReferenceSniff extends Sniff { |
|
35 | 34 | |
36 | 35 | /** |
37 | 36 | * Tokens that represent assignments or equality comparisons. |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | * |
75 | 74 | * @return array |
76 | 75 | */ |
77 | - public function register() |
|
78 | - { |
|
76 | + public function register() { |
|
79 | 77 | return array( |
80 | 78 | \T_STRING, |
81 | 79 | \T_VARIABLE, |
@@ -91,8 +89,7 @@ discard block |
||
91 | 89 | * |
92 | 90 | * @return void |
93 | 91 | */ |
94 | - public function process(File $phpcsFile, $stackPtr) |
|
95 | - { |
|
92 | + public function process(File $phpcsFile, $stackPtr) { |
|
96 | 93 | if ($this->supportsAbove('5.3') === false) { |
97 | 94 | return; |
98 | 95 | } |
@@ -168,8 +165,7 @@ discard block |
||
168 | 165 | * |
169 | 166 | * @return bool |
170 | 167 | */ |
171 | - protected function isCallTimePassByReferenceParam(File $phpcsFile, $parameter, $nestingLevel) |
|
172 | - { |
|
168 | + protected function isCallTimePassByReferenceParam(File $phpcsFile, $parameter, $nestingLevel) { |
|
173 | 169 | $tokens = $phpcsFile->getTokens(); |
174 | 170 | |
175 | 171 | $searchStartToken = $parameter['start'] - 1; |
@@ -29,16 +29,14 @@ discard block |
||
29 | 29 | * @package PHPCompatibility |
30 | 30 | * @author Juliette Reinders Folmer <[email protected]> |
31 | 31 | */ |
32 | -class NewClassMemberAccessSniff extends Sniff |
|
33 | -{ |
|
32 | +class NewClassMemberAccessSniff extends Sniff { |
|
34 | 33 | |
35 | 34 | /** |
36 | 35 | * Returns an array of tokens this test wants to listen for. |
37 | 36 | * |
38 | 37 | * @return array |
39 | 38 | */ |
40 | - public function register() |
|
41 | - { |
|
39 | + public function register() { |
|
42 | 40 | return array( |
43 | 41 | \T_NEW, |
44 | 42 | \T_CLONE, |
@@ -54,8 +52,7 @@ discard block |
||
54 | 52 | * |
55 | 53 | * @return void |
56 | 54 | */ |
57 | - public function process(File $phpcsFile, $stackPtr) |
|
58 | - { |
|
55 | + public function process(File $phpcsFile, $stackPtr) { |
|
59 | 56 | $tokens = $phpcsFile->getTokens(); |
60 | 57 | |
61 | 58 | if ($tokens[$stackPtr]['code'] === \T_NEW && $this->supportsBelow('5.3') !== true) { |
@@ -24,15 +24,13 @@ discard block |
||
24 | 24 | * @package PHPCompatibility |
25 | 25 | * @author Wim Godden <[email protected]> |
26 | 26 | */ |
27 | -class NewFunctionArrayDereferencingSniff extends Sniff |
|
28 | -{ |
|
27 | +class NewFunctionArrayDereferencingSniff extends Sniff { |
|
29 | 28 | /** |
30 | 29 | * Returns an array of tokens this test wants to listen for. |
31 | 30 | * |
32 | 31 | * @return array |
33 | 32 | */ |
34 | - public function register() |
|
35 | - { |
|
33 | + public function register() { |
|
36 | 34 | return array(\T_STRING); |
37 | 35 | } |
38 | 36 | |
@@ -45,8 +43,7 @@ discard block |
||
45 | 43 | * |
46 | 44 | * @return void |
47 | 45 | */ |
48 | - public function process(File $phpcsFile, $stackPtr) |
|
49 | - { |
|
46 | + public function process(File $phpcsFile, $stackPtr) { |
|
50 | 47 | if ($this->supportsBelow('5.3') === false) { |
51 | 48 | return; |
52 | 49 | } |
@@ -26,15 +26,13 @@ discard block |
||
26 | 26 | * @package PHPCompatibility |
27 | 27 | * @author Juliette Reinders Folmer <[email protected]> |
28 | 28 | */ |
29 | -class NewArrayStringDereferencingSniff extends Sniff |
|
30 | -{ |
|
29 | +class NewArrayStringDereferencingSniff extends Sniff { |
|
31 | 30 | /** |
32 | 31 | * Returns an array of tokens this test wants to listen for. |
33 | 32 | * |
34 | 33 | * @return array |
35 | 34 | */ |
36 | - public function register() |
|
37 | - { |
|
35 | + public function register() { |
|
38 | 36 | return array( |
39 | 37 | \T_ARRAY, |
40 | 38 | \T_OPEN_SHORT_ARRAY, |
@@ -51,8 +49,7 @@ discard block |
||
51 | 49 | * |
52 | 50 | * @return void |
53 | 51 | */ |
54 | - public function process(File $phpcsFile, $stackPtr) |
|
55 | - { |
|
52 | + public function process(File $phpcsFile, $stackPtr) { |
|
56 | 53 | if ($this->supportsBelow('5.4') === false) { |
57 | 54 | return; |
58 | 55 | } |