diff --git a/phpcs.xml.dist b/phpcs.xml.dist index cb1d5d45b0..2b0c61516e 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -58,6 +58,8 @@ + + @@ -133,6 +135,7 @@ + @@ -150,7 +153,7 @@ - tests/Core/Tokenizers/PHP/StableCommentWhitespaceWinTest\.php + tests/Core/Tokenizers/PHP/*WinTest\.php @@ -161,4 +164,7 @@ + + + diff --git a/src/Config.php b/src/Config.php index ebd8e0511a..480abce696 100644 --- a/src/Config.php +++ b/src/Config.php @@ -1592,7 +1592,7 @@ public static function getExecutablePath(string $name) return $data; } - if ($name === "php") { + if ($name === 'php') { // For php, we know the executable path. There's no need to look it up. return PHP_BINARY; } diff --git a/src/Files/File.php b/src/Files/File.php index 84aaeba56a..99ab24097d 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -1229,7 +1229,7 @@ public function getFixedWarningCount() * * @return int */ - public function getFirstRunCount(string $type):int + public function getFirstRunCount(string $type): int { return $this->firstRunCounts[$type]; diff --git a/src/Reports/Json.php b/src/Reports/Json.php index 55fe4aa2ef..4447cbaef7 100644 --- a/src/Reports/Json.php +++ b/src/Reports/Json.php @@ -57,7 +57,7 @@ public function generateFileReport(array $report, File $phpcsFile, bool $showSou $messagesObject->column = $column; $messagesObject->fixable = $fixable; - $messages .= json_encode($messagesObject).","; + $messages .= json_encode($messagesObject).','; } } }//end foreach @@ -99,7 +99,7 @@ public function generate( ) { echo '{"totals":{"errors":'.$totalErrors.',"warnings":'.$totalWarnings.',"fixable":'.$totalFixable.'},"files":{'; echo rtrim($cachedData, ','); - echo "}}".PHP_EOL; + echo '}}'.PHP_EOL; }//end generate() diff --git a/tests/Core/Ruleset/ExplainTest.php b/tests/Core/Ruleset/ExplainTest.php index bb01e50abe..e74afe950b 100644 --- a/tests/Core/Ruleset/ExplainTest.php +++ b/tests/Core/Ruleset/ExplainTest.php @@ -179,7 +179,7 @@ public function testExplainCustomRuleset() public function testExplainWithDeprecatedSniffs() { // Set up the ruleset. - $standard = __DIR__."/ShowSniffDeprecationsTest.xml"; + $standard = __DIR__.'/ShowSniffDeprecationsTest.xml'; $config = new ConfigDouble(["--standard=$standard", '-e']); $ruleset = new Ruleset($config); diff --git a/tests/Core/Ruleset/GetIgnorePatternsTest.php b/tests/Core/Ruleset/GetIgnorePatternsTest.php index 23fe0532c9..ce185d3ead 100644 --- a/tests/Core/Ruleset/GetIgnorePatternsTest.php +++ b/tests/Core/Ruleset/GetIgnorePatternsTest.php @@ -37,7 +37,7 @@ final class GetIgnorePatternsTest extends TestCase public static function setUpBeforeClass(): void { // Set up the ruleset. - $standard = __DIR__."/GetIgnorePatternsTest.xml"; + $standard = __DIR__.'/GetIgnorePatternsTest.xml'; $config = new ConfigDouble(["--standard=$standard"]); self::$ruleset = new Ruleset($config); diff --git a/tests/Core/Ruleset/GetIncludePatternsTest.php b/tests/Core/Ruleset/GetIncludePatternsTest.php index b67c189e11..5d32c446d2 100644 --- a/tests/Core/Ruleset/GetIncludePatternsTest.php +++ b/tests/Core/Ruleset/GetIncludePatternsTest.php @@ -37,7 +37,7 @@ final class GetIncludePatternsTest extends TestCase public static function setUpBeforeClass(): void { // Set up the ruleset. - $standard = __DIR__."/GetIncludePatternsTest.xml"; + $standard = __DIR__.'/GetIncludePatternsTest.xml'; $config = new ConfigDouble(["--standard=$standard"]); self::$ruleset = new Ruleset($config); diff --git a/tests/Core/Tokenizers/PHP/AttributesTest.php b/tests/Core/Tokenizers/PHP/AttributesTest.php index 415971a98d..75d3b458f2 100644 --- a/tests/Core/Tokenizers/PHP/AttributesTest.php +++ b/tests/Core/Tokenizers/PHP/AttributesTest.php @@ -540,7 +540,7 @@ public static function dataAttributeOnTextLookingLikeCloseTag() ], [ 'T_WHITESPACE', - " ", + ' ', ], [ 'T_CONSTANT_ENCAPSED_STRING', diff --git a/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php b/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php index deae18e9a6..fbe95c4130 100644 --- a/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php +++ b/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php @@ -33,7 +33,7 @@ public function testTabWidthNotSet() $config = new ConfigDouble(); $ruleset = new Ruleset($config); - $content = <<tabWidth = 4; $ruleset = new Ruleset($config); - $content = << "\\r\\n\\t", ], 'Spaces are replaced with a unique mark' => [ - 'content' => " ", + 'content' => ' ', 'exclude' => [], 'expected' => "\033[30;1m·\033[0m\033[30;1m·\033[0m\033[30;1m·\033[0m\033[30;1m·\033[0m", - 'expectedWin' => " ", + 'expectedWin' => ' ', ], 'Other characters are unaffected' => [ - 'content' => "{echo 1;}", + 'content' => '{echo 1;}', 'exclude' => [], 'expected' => "{echo\033[30;1m·\033[0m1;}", - 'expectedWin' => "{echo 1;}", + 'expectedWin' => '{echo 1;}', ], 'No replacements' => [ 'content' => 'nothing-should-be-replaced',