@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | use PHP_CodeSniffer\Exceptions\RuntimeException; |
16 | 16 | use PHP_CodeSniffer\Exceptions\DeepExitException; |
17 | 17 | |
18 | -class Config |
|
19 | -{ |
|
18 | +class Config { |
|
20 | 19 | |
21 | 20 | /** |
22 | 21 | * The current version. |
@@ -190,8 +189,7 @@ discard block |
||
190 | 189 | * @return mixed |
191 | 190 | * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid. |
192 | 191 | */ |
193 | - public function __get($name) |
|
194 | - { |
|
192 | + public function __get($name) { |
|
195 | 193 | if (array_key_exists($name, $this->settings) === false) { |
196 | 194 | throw new RuntimeException("ERROR: unable to get value of property \"$name\""); |
197 | 195 | } |
@@ -210,8 +208,7 @@ discard block |
||
210 | 208 | * @return void |
211 | 209 | * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the setting name is invalid. |
212 | 210 | */ |
213 | - public function __set($name, $value) |
|
214 | - { |
|
211 | + public function __set($name, $value) { |
|
215 | 212 | if (array_key_exists($name, $this->settings) === false) { |
216 | 213 | throw new RuntimeException("Can't __set() $name; setting doesn't exist"); |
217 | 214 | } |
@@ -260,8 +257,7 @@ discard block |
||
260 | 257 | * |
261 | 258 | * @return bool |
262 | 259 | */ |
263 | - public function __isset($name) |
|
264 | - { |
|
260 | + public function __isset($name) { |
|
265 | 261 | return isset($this->settings[$name]); |
266 | 262 | |
267 | 263 | }//end __isset() |
@@ -274,8 +270,7 @@ discard block |
||
274 | 270 | * |
275 | 271 | * @return void |
276 | 272 | */ |
277 | - public function __unset($name) |
|
278 | - { |
|
273 | + public function __unset($name) { |
|
279 | 274 | $this->settings[$name] = null; |
280 | 275 | |
281 | 276 | }//end __unset() |
@@ -286,8 +281,7 @@ discard block |
||
286 | 281 | * |
287 | 282 | * @return array<string, mixed> |
288 | 283 | */ |
289 | - public function getSettings() |
|
290 | - { |
|
284 | + public function getSettings() { |
|
291 | 285 | return $this->settings; |
292 | 286 | |
293 | 287 | }//end getSettings() |
@@ -300,8 +294,7 @@ discard block |
||
300 | 294 | * |
301 | 295 | * @return void |
302 | 296 | */ |
303 | - public function setSettings($settings) |
|
304 | - { |
|
297 | + public function setSettings($settings) { |
|
305 | 298 | return $this->settings = $settings; |
306 | 299 | |
307 | 300 | }//end setSettings() |
@@ -316,8 +309,7 @@ discard block |
||
316 | 309 | * |
317 | 310 | * @return void |
318 | 311 | */ |
319 | - public function __construct(array $cliArgs=[], $dieOnUnknownArg=true) |
|
320 | - { |
|
312 | + public function __construct(array $cliArgs=[], $dieOnUnknownArg=true) { |
|
321 | 313 | if (defined('PHP_CODESNIFFER_IN_TESTS') === true) { |
322 | 314 | // Let everything through during testing so that we can |
323 | 315 | // make use of PHPUnit command line arguments as well. |
@@ -406,8 +398,7 @@ discard block |
||
406 | 398 | * |
407 | 399 | * @return void |
408 | 400 | */ |
409 | - public function setCommandLineValues($args) |
|
410 | - { |
|
401 | + public function setCommandLineValues($args) { |
|
411 | 402 | $this->cliArgs = $args; |
412 | 403 | $numArgs = count($args); |
413 | 404 | |
@@ -455,8 +446,7 @@ discard block |
||
455 | 446 | * |
456 | 447 | * @return array |
457 | 448 | */ |
458 | - public function restoreDefaults() |
|
459 | - { |
|
449 | + public function restoreDefaults() { |
|
460 | 450 | $this->files = []; |
461 | 451 | $this->standards = ['PEAR']; |
462 | 452 | $this->verbosity = 0; |
@@ -585,8 +575,7 @@ discard block |
||
585 | 575 | * |
586 | 576 | * @return void |
587 | 577 | */ |
588 | - public function processShortArgument($arg, $pos) |
|
589 | - { |
|
578 | + public function processShortArgument($arg, $pos) { |
|
590 | 579 | switch ($arg) { |
591 | 580 | case 'h': |
592 | 581 | case '?': |
@@ -689,8 +678,7 @@ discard block |
||
689 | 678 | * |
690 | 679 | * @return void |
691 | 680 | */ |
692 | - public function processLongArgument($arg, $pos) |
|
693 | - { |
|
681 | + public function processLongArgument($arg, $pos) { |
|
694 | 682 | switch ($arg) { |
695 | 683 | case 'help': |
696 | 684 | ob_start(); |
@@ -1250,8 +1238,7 @@ discard block |
||
1250 | 1238 | * |
1251 | 1239 | * @return void |
1252 | 1240 | */ |
1253 | - public function processUnknownArgument($arg, $pos) |
|
1254 | - { |
|
1241 | + public function processUnknownArgument($arg, $pos) { |
|
1255 | 1242 | // We don't know about any additional switches; just files. |
1256 | 1243 | if ($arg{0} === '-') { |
1257 | 1244 | if ($this->dieOnUnknownArg === false) { |
@@ -1275,8 +1262,7 @@ discard block |
||
1275 | 1262 | * |
1276 | 1263 | * @return void |
1277 | 1264 | */ |
1278 | - public function processFilePath($path) |
|
1279 | - { |
|
1265 | + public function processFilePath($path) { |
|
1280 | 1266 | // If we are processing STDIN, don't record any files to check. |
1281 | 1267 | if ($this->stdin === true) { |
1282 | 1268 | return; |
@@ -1308,8 +1294,7 @@ discard block |
||
1308 | 1294 | * |
1309 | 1295 | * @return void |
1310 | 1296 | */ |
1311 | - public function printUsage() |
|
1312 | - { |
|
1297 | + public function printUsage() { |
|
1313 | 1298 | echo PHP_EOL; |
1314 | 1299 | |
1315 | 1300 | if (PHP_CODESNIFFER_CBF === true) { |
@@ -1331,8 +1316,7 @@ discard block |
||
1331 | 1316 | * |
1332 | 1317 | * @return string|void |
1333 | 1318 | */ |
1334 | - public function printShortUsage($return=false) |
|
1335 | - { |
|
1319 | + public function printShortUsage($return=false) { |
|
1336 | 1320 | if (PHP_CODESNIFFER_CBF === true) { |
1337 | 1321 | $usage = 'Run "phpcbf --help" for usage information'; |
1338 | 1322 | } else { |
@@ -1355,8 +1339,7 @@ discard block |
||
1355 | 1339 | * |
1356 | 1340 | * @return void |
1357 | 1341 | */ |
1358 | - public function printPHPCSUsage() |
|
1359 | - { |
|
1342 | + public function printPHPCSUsage() { |
|
1360 | 1343 | echo 'Usage: phpcs [-nwlsaepqvi] [-d key[=value]] [--colors] [--no-colors]'.PHP_EOL; |
1361 | 1344 | echo ' [--cache[=<cacheFile>]] [--no-cache] [--tab-width=<tabWidth>]'.PHP_EOL; |
1362 | 1345 | echo ' [--report=<report>] [--report-file=<reportFile>] [--report-<report>=<reportFile>]'.PHP_EOL; |
@@ -1430,8 +1413,7 @@ discard block |
||
1430 | 1413 | * |
1431 | 1414 | * @return void |
1432 | 1415 | */ |
1433 | - public function printPHPCBFUsage() |
|
1434 | - { |
|
1416 | + public function printPHPCBFUsage() { |
|
1435 | 1417 | echo 'Usage: phpcbf [-nwli] [-d key[=value]] [--ignore-annotations] [--bootstrap=<bootstrap>]'.PHP_EOL; |
1436 | 1418 | echo ' [--standard=<standard>] [--sniffs=<sniffs>] [--exclude=<sniffs>] [--suffix=<suffix>]'.PHP_EOL; |
1437 | 1419 | echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL; |
@@ -1487,8 +1469,7 @@ discard block |
||
1487 | 1469 | * @see setConfigData() |
1488 | 1470 | * @see getAllConfigData() |
1489 | 1471 | */ |
1490 | - public static function getConfigData($key) |
|
1491 | - { |
|
1472 | + public static function getConfigData($key) { |
|
1492 | 1473 | $phpCodeSnifferConfig = self::getAllConfigData(); |
1493 | 1474 | |
1494 | 1475 | if ($phpCodeSnifferConfig === null) { |
@@ -1512,8 +1493,7 @@ discard block |
||
1512 | 1493 | * @return string|null |
1513 | 1494 | * @see getConfigData() |
1514 | 1495 | */ |
1515 | - public static function getExecutablePath($name) |
|
1516 | - { |
|
1496 | + public static function getExecutablePath($name) { |
|
1517 | 1497 | $data = self::getConfigData($name.'_path'); |
1518 | 1498 | if ($data !== null) { |
1519 | 1499 | return $data; |
@@ -1560,8 +1540,7 @@ discard block |
||
1560 | 1540 | * @see getConfigData() |
1561 | 1541 | * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the config file can not be written. |
1562 | 1542 | */ |
1563 | - public static function setConfigData($key, $value, $temp=false) |
|
1564 | - { |
|
1543 | + public static function setConfigData($key, $value, $temp=false) { |
|
1565 | 1544 | if (isset(self::$overriddenDefaults['runtime-set']) === true |
1566 | 1545 | && isset(self::$overriddenDefaults['runtime-set'][$key]) === true |
1567 | 1546 | ) { |
@@ -1640,8 +1619,7 @@ discard block |
||
1640 | 1619 | * @return array<string, string> |
1641 | 1620 | * @see getConfigData() |
1642 | 1621 | */ |
1643 | - public static function getAllConfigData() |
|
1644 | - { |
|
1622 | + public static function getAllConfigData() { |
|
1645 | 1623 | if (self::$configData !== null) { |
1646 | 1624 | return self::$configData; |
1647 | 1625 | } |
@@ -1687,8 +1665,7 @@ discard block |
||
1687 | 1665 | * |
1688 | 1666 | * @return void |
1689 | 1667 | */ |
1690 | - public function printConfigData($data) |
|
1691 | - { |
|
1668 | + public function printConfigData($data) { |
|
1692 | 1669 | $max = 0; |
1693 | 1670 | $keys = array_keys($data); |
1694 | 1671 | foreach ($keys as $key) { |
@@ -16,8 +16,7 @@ |
||
16 | 16 | |
17 | 17 | use PHP_CodeSniffer\Files\File; |
18 | 18 | |
19 | -interface Sniff |
|
20 | -{ |
|
19 | +interface Sniff { |
|
21 | 20 | |
22 | 21 | |
23 | 22 | /** |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | use PHP_CodeSniffer\Files\File; |
30 | 30 | use PHP_CodeSniffer\Exceptions\RuntimeException; |
31 | 31 | |
32 | -abstract class AbstractScopeSniff implements Sniff |
|
33 | -{ |
|
32 | +abstract class AbstractScopeSniff implements Sniff { |
|
34 | 33 | |
35 | 34 | /** |
36 | 35 | * The token types that this test wishes to listen to within the scope. |
@@ -107,8 +106,7 @@ discard block |
||
107 | 106 | * @return int[] |
108 | 107 | * @see __constructor() |
109 | 108 | */ |
110 | - final public function register() |
|
111 | - { |
|
109 | + final public function register() { |
|
112 | 110 | return $this->tokens; |
113 | 111 | |
114 | 112 | }//end register() |
@@ -127,8 +125,7 @@ discard block |
||
127 | 125 | * the rest of the file. |
128 | 126 | * @see processTokenWithinScope() |
129 | 127 | */ |
130 | - final public function process(File $phpcsFile, $stackPtr) |
|
131 | - { |
|
128 | + final public function process(File $phpcsFile, $stackPtr) { |
|
132 | 129 | $tokens = $phpcsFile->getTokens(); |
133 | 130 | |
134 | 131 | $foundScope = false; |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | use PHP_CodeSniffer\Tokenizers\PHP; |
15 | 15 | use PHP_CodeSniffer\Exceptions\RuntimeException; |
16 | 16 | |
17 | -abstract class AbstractPatternSniff implements Sniff |
|
18 | -{ |
|
17 | +abstract class AbstractPatternSniff implements Sniff { |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * If true, comments will be ignored if they are found in the code. |
@@ -60,8 +59,7 @@ discard block |
||
60 | 59 | * |
61 | 60 | * @param boolean $ignoreComments If true, comments will be ignored. |
62 | 61 | */ |
63 | - public function __construct($ignoreComments=null) |
|
64 | - { |
|
62 | + public function __construct($ignoreComments=null) { |
|
65 | 63 | // This is here for backwards compatibility. |
66 | 64 | if ($ignoreComments !== null) { |
67 | 65 | $this->ignoreComments = $ignoreComments; |
@@ -81,8 +79,7 @@ discard block |
||
81 | 79 | * @return int[] |
82 | 80 | * @see process() |
83 | 81 | */ |
84 | - final public function register() |
|
85 | - { |
|
82 | + final public function register() { |
|
86 | 83 | $listenTypes = []; |
87 | 84 | $patterns = $this->getPatterns(); |
88 | 85 | |
@@ -129,8 +126,7 @@ discard block |
||
129 | 126 | * |
130 | 127 | * @return array<int, int> |
131 | 128 | */ |
132 | - private function getPatternTokenTypes($pattern) |
|
133 | - { |
|
129 | + private function getPatternTokenTypes($pattern) { |
|
134 | 130 | $tokenTypes = []; |
135 | 131 | foreach ($pattern as $pos => $patternInfo) { |
136 | 132 | if ($patternInfo['type'] === 'token') { |
@@ -155,8 +151,7 @@ discard block |
||
155 | 151 | * as the listener. |
156 | 152 | * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If we could not determine a token to listen for. |
157 | 153 | */ |
158 | - private function getListenerTokenPos($pattern) |
|
159 | - { |
|
154 | + private function getListenerTokenPos($pattern) { |
|
160 | 155 | $tokenTypes = $this->getPatternTokenTypes($pattern); |
161 | 156 | $tokenCodes = array_keys($tokenTypes); |
162 | 157 | $token = Tokens::getHighestWeightedToken($tokenCodes); |
@@ -184,8 +179,7 @@ discard block |
||
184 | 179 | * @return void |
185 | 180 | * @see register() |
186 | 181 | */ |
187 | - final public function process(File $phpcsFile, $stackPtr) |
|
188 | - { |
|
182 | + final public function process(File $phpcsFile, $stackPtr) { |
|
189 | 183 | $file = $phpcsFile->getFilename(); |
190 | 184 | if ($this->currFile !== $file) { |
191 | 185 | // We have changed files, so clean up. |
@@ -252,8 +246,7 @@ discard block |
||
252 | 246 | * |
253 | 247 | * @return array |
254 | 248 | */ |
255 | - protected function processPattern($patternInfo, File $phpcsFile, $stackPtr) |
|
256 | - { |
|
249 | + protected function processPattern($patternInfo, File $phpcsFile, $stackPtr) { |
|
257 | 250 | $tokens = $phpcsFile->getTokens(); |
258 | 251 | $pattern = $patternInfo['pattern']; |
259 | 252 | $patternCode = $patternInfo['pattern_code']; |
@@ -698,8 +691,7 @@ discard block |
||
698 | 691 | * |
699 | 692 | * @return string The error message. |
700 | 693 | */ |
701 | - protected function prepareError($found, $patternCode) |
|
702 | - { |
|
694 | + protected function prepareError($found, $patternCode) { |
|
703 | 695 | $found = str_replace("\r\n", '\n', $found); |
704 | 696 | $found = str_replace("\n", '\n', $found); |
705 | 697 | $found = str_replace("\r", '\n', $found); |
@@ -732,8 +724,7 @@ discard block |
||
732 | 724 | * @return int[] |
733 | 725 | * @see processSupplementary() |
734 | 726 | */ |
735 | - protected function registerSupplementary() |
|
736 | - { |
|
727 | + protected function registerSupplementary() { |
|
737 | 728 | return []; |
738 | 729 | |
739 | 730 | }//end registerSupplementary() |
@@ -750,8 +741,7 @@ discard block |
||
750 | 741 | * @return void |
751 | 742 | * @see registerSupplementary() |
752 | 743 | */ |
753 | - protected function processSupplementary(File $phpcsFile, $stackPtr) |
|
754 | - { |
|
744 | + protected function processSupplementary(File $phpcsFile, $stackPtr) { |
|
755 | 745 | |
756 | 746 | }//end processSupplementary() |
757 | 747 | |
@@ -765,8 +755,7 @@ discard block |
||
765 | 755 | * @see createSkipPattern() |
766 | 756 | * @see createTokenPattern() |
767 | 757 | */ |
768 | - private function parse($pattern) |
|
769 | - { |
|
758 | + private function parse($pattern) { |
|
770 | 759 | $patterns = []; |
771 | 760 | $length = strlen($pattern); |
772 | 761 | $lastToken = 0; |
@@ -856,8 +845,7 @@ discard block |
||
856 | 845 | * @see createTokenPattern() |
857 | 846 | * @see parse() |
858 | 847 | */ |
859 | - private function createSkipPattern($pattern, $from) |
|
860 | - { |
|
848 | + private function createSkipPattern($pattern, $from) { |
|
861 | 849 | $skip = ['type' => 'skip']; |
862 | 850 | |
863 | 851 | $nestedParenthesis = 0; |
@@ -909,8 +897,7 @@ discard block |
||
909 | 897 | * @see createSkipPattern() |
910 | 898 | * @see parse() |
911 | 899 | */ |
912 | - private function createTokenPattern($str) |
|
913 | - { |
|
900 | + private function createTokenPattern($str) { |
|
914 | 901 | // Don't add a space after the closing php tag as it will add a new |
915 | 902 | // whitespace token. |
916 | 903 | $tokenizer = new PHP('<?php '.$str.'?>', null); |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | use PHP_CodeSniffer\Files\File; |
13 | 13 | use PHP_CodeSniffer\Util\Tokens; |
14 | 14 | |
15 | -abstract class AbstractArraySniff implements Sniff |
|
16 | -{ |
|
15 | +abstract class AbstractArraySniff implements Sniff { |
|
17 | 16 | |
18 | 17 | |
19 | 18 | /** |
@@ -21,8 +20,7 @@ discard block |
||
21 | 20 | * |
22 | 21 | * @return array |
23 | 22 | */ |
24 | - final public function register() |
|
25 | - { |
|
23 | + final public function register() { |
|
26 | 24 | return [ |
27 | 25 | T_ARRAY, |
28 | 26 | T_OPEN_SHORT_ARRAY, |
@@ -40,8 +38,7 @@ discard block |
||
40 | 38 | * |
41 | 39 | * @return void |
42 | 40 | */ |
43 | - public function process(File $phpcsFile, $stackPtr) |
|
44 | - { |
|
41 | + public function process(File $phpcsFile, $stackPtr) { |
|
45 | 42 | $tokens = $phpcsFile->getTokens(); |
46 | 43 | |
47 | 44 | if ($tokens[$stackPtr]['code'] === T_ARRAY) { |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | use PHP_CodeSniffer\Files\File; |
19 | 19 | use PHP_CodeSniffer\Util\Tokens; |
20 | 20 | |
21 | -abstract class AbstractVariableSniff extends AbstractScopeSniff |
|
22 | -{ |
|
21 | +abstract class AbstractVariableSniff extends AbstractScopeSniff { |
|
23 | 22 | |
24 | 23 | |
25 | 24 | /** |
@@ -48,8 +47,7 @@ discard block |
||
48 | 47 | /** |
49 | 48 | * Constructs an AbstractVariableTest. |
50 | 49 | */ |
51 | - public function __construct() |
|
52 | - { |
|
50 | + public function __construct() { |
|
53 | 51 | $scopes = Tokens::$ooScopeTokens; |
54 | 52 | |
55 | 53 | $listen = [ |
@@ -76,8 +74,7 @@ discard block |
||
76 | 74 | * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip |
77 | 75 | * the rest of the file. |
78 | 76 | */ |
79 | - final protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) |
|
80 | - { |
|
77 | + final protected function processTokenWithinScope(File $phpcsFile, $stackPtr, $currScope) { |
|
81 | 78 | $tokens = $phpcsFile->getTokens(); |
82 | 79 | |
83 | 80 | if ($tokens[$stackPtr]['code'] === T_DOUBLE_QUOTED_STRING |
@@ -160,8 +157,7 @@ discard block |
||
160 | 157 | * pointer is reached. Return ($phpcsFile->numTokens + 1) to skip |
161 | 158 | * the rest of the file. |
162 | 159 | */ |
163 | - final protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) |
|
164 | - { |
|
160 | + final protected function processTokenOutsideScope(File $phpcsFile, $stackPtr) { |
|
165 | 161 | $tokens = $phpcsFile->getTokens(); |
166 | 162 | // These variables are not member vars. |
167 | 163 | if ($tokens[$stackPtr]['code'] === T_VARIABLE) { |
@@ -81,8 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] = array(); |
83 | 83 | |
84 | -class MyClass |
|
85 | -{ |
|
84 | +class MyClass { |
|
86 | 85 | const MODE_DEBUG = 'debug'; |
87 | 86 | const MODE_DEBUG2 = 'debug'; |
88 | 87 | |
@@ -96,8 +95,7 @@ discard block |
||
96 | 95 | var $array[($blah + (10 - $test))] = 'anything'; |
97 | 96 | } |
98 | 97 | |
99 | -function myFunction($var=true) |
|
100 | -{ |
|
98 | +function myFunction($var=true) { |
|
101 | 99 | if ($strict === true) { |
102 | 100 | $length = strlen($string); |
103 | 101 | $lastCharWasCaps = ($classFormat === false) ? false : true; |
@@ -242,8 +240,7 @@ discard block |
||
242 | 240 | $foo = 5; |
243 | 241 | |
244 | 242 | $loggerResult = $util->setLogger(new class { |
245 | - public function log($msg) |
|
246 | - { |
|
243 | + public function log($msg) { |
|
247 | 244 | echo $msg; |
248 | 245 | } |
249 | 246 | }); |
@@ -272,32 +269,28 @@ discard block |
||
272 | 269 | ]; |
273 | 270 | $barbar = 'bar'; |
274 | 271 | |
275 | -function buildForm(FormBuilderInterface $builder, array $options) |
|
276 | -{ |
|
272 | +function buildForm(FormBuilderInterface $builder, array $options) { |
|
277 | 273 | $transformer = new ContractTransformer($options['contracts']); |
278 | 274 | $types = ['support.contact.question' => ContactData::QUESTION]; |
279 | 275 | |
280 | 276 | [$important, $questions, $incidents, $requests] = $this->createContractBuckets($options['contracts']); |
281 | 277 | } |
282 | 278 | |
283 | -function buildForm(FormBuilderInterface $builder, array $options) |
|
284 | -{ |
|
279 | +function buildForm(FormBuilderInterface $builder, array $options) { |
|
285 | 280 | $transformer = new ContractTransformer($options['contracts']); |
286 | 281 | $types = ['support.contact.question' => ContactData::QUESTION]; |
287 | 282 | [$important, $questions, $incidents, $requests] = $this->createContractBuckets($options['contracts']); |
288 | 283 | } |
289 | 284 | |
290 | 285 | $loggerResult = $util->setLogger(new class { |
291 | - public function log($msg) |
|
292 | - { |
|
286 | + public function log($msg) { |
|
293 | 287 | $a = $msg; |
294 | 288 | $foobar = $msg; |
295 | 289 | $foo = function() { |
296 | 290 | $a = $msg; |
297 | 291 | $foobar = $msg; |
298 | 292 | $loggerResult = $util->setLogger(new class { |
299 | - public function log($msg) |
|
300 | - { |
|
293 | + public function log($msg) { |
|
301 | 294 | $a = $msg; |
302 | 295 | $foobar = $msg; |
303 | 296 | $foo = function() { |
@@ -324,8 +317,7 @@ discard block |
||
324 | 317 | $bar = $msg; |
325 | 318 | } |
326 | 319 | |
327 | - public function log2($msg) |
|
328 | - { |
|
320 | + public function log2($msg) { |
|
329 | 321 | $a = $msg; |
330 | 322 | $foobar = $msg; |
331 | 323 | $foo = function() { |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class NoSpaceAfterCastUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class NoSpaceAfterCastUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * |
24 | 23 | * @return array<int, int> |
25 | 24 | */ |
26 | - public function getErrorList() |
|
27 | - { |
|
25 | + public function getErrorList() { |
|
28 | 26 | return [ |
29 | 27 | 3 => 1, |
30 | 28 | 5 => 1, |
@@ -62,8 +60,7 @@ discard block |
||
62 | 60 | * |
63 | 61 | * @return array<int, int> |
64 | 62 | */ |
65 | - public function getWarningList() |
|
66 | - { |
|
63 | + public function getWarningList() { |
|
67 | 64 | return []; |
68 | 65 | |
69 | 66 | }//end getWarningList() |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class DisallowMultipleStatementsUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class DisallowMultipleStatementsUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * |
24 | 23 | * @return array<int, int> |
25 | 24 | */ |
26 | - public function getErrorList() |
|
27 | - { |
|
25 | + public function getErrorList() { |
|
28 | 26 | return [ |
29 | 27 | 2 => 1, |
30 | 28 | 6 => 1, |
@@ -44,8 +42,7 @@ discard block |
||
44 | 42 | * |
45 | 43 | * @return array<int, int> |
46 | 44 | */ |
47 | - public function getWarningList() |
|
48 | - { |
|
45 | + public function getWarningList() { |
|
49 | 46 | return []; |
50 | 47 | |
51 | 48 | }//end getWarningList() |