Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 1 addition & 6 deletions src/Fixer/PhpUnitRequiresConstraintFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixer/PhpUnitRequiresConstraintFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
};
Expand Down