diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e3ba62f..87db3237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG for PHP CS Fixer: custom fixers +## v3.29.0 +- Update minimum PHP CS Fixer version to 3.77.0 + ## v3.28.0 - Deprecate MultilinePromotedPropertiesFixer - use "multiline_promoted_properties" - Update minimum PHP CS Fixer version to 3.76.0 diff --git a/composer.json b/composer.json index d91973ce..8777b9bc 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "^7.4 || ^8.0", "ext-filter": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.76" + "friendsofphp/php-cs-fixer": "^3.77" }, "require-dev": { "phpunit/phpunit": "^9.6.22 || 10.5.45 || ^11.5.7" diff --git a/src/Fixer/PhpUnitRequiresConstraintFixer.php b/src/Fixer/PhpUnitRequiresConstraintFixer.php index d0288d23..8f658795 100644 --- a/src/Fixer/PhpUnitRequiresConstraintFixer.php +++ b/src/Fixer/PhpUnitRequiresConstraintFixer.php @@ -81,16 +81,11 @@ public function fix(\SplFileInfo $file, Tokens $tokens): void private static function fixClass(Tokens $tokens, int $index, int $endIndex): void { while ($index < $endIndex) { - $index = $tokens->getNextTokenOfKind($index, ['{', [\T_FUNCTION]]); + $index = $tokens->getNextTokenOfKind($index, [[\T_FUNCTION]]); if ($index === null || $index >= $endIndex) { return; } - if ($tokens[$index]->equals('{')) { - $index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index); - continue; - } - self::fixMethod($tokens, $index); } } diff --git a/tests/Fixer/PhpUnitRequiresConstraintFixerTest.php b/tests/Fixer/PhpUnitRequiresConstraintFixerTest.php index d8890f4a..1faab496 100644 --- a/tests/Fixer/PhpUnitRequiresConstraintFixerTest.php +++ b/tests/Fixer/PhpUnitRequiresConstraintFixerTest.php @@ -72,7 +72,7 @@ public function testFoo1() {} public function testFo2o() { new class extends TestCase { /** - * @requires PHP 8.2 + * @requires PHP >= 8.2 */ public function testX() {} };