Repository navigation
Conversation
lyrixx
force-pushed
the
fix-phpunit-warnings
branch
from
October 14, 2026 07:51
64974f4 to
c717182
Compare
lyrixx
force-pushed
the
fix-phpunit-warnings
branch
from
October 14, 2026 07:56
c717182 to
a78351c
Compare
GromNaN
approved these changes
Oct 14, 2026
| { | ||
| return [ | ||
| // test methods must not have a return type | ||
| 'void_return' => static fn (SplFileInfo $file) => !str_starts_with($file->getPathname(), __DIR__.'/tests/'), |
Member
There was a problem hiding this comment.
Fabbot's PHP-CS-Fixer step adds : void to test methods (void_return from @symfony:risky), while its next step requires test methods not to have a return type. The PHP-CS-Fixer config now disables void_return in tests/, like symfony/symfony does.
Great but complex fix! We have the same issue on other MakerBundle and MonologBundle.
Member
There was a problem hiding this comment.
FYI Twig and Symfony UX do not follow this rule anymore, ref: symfony-tools/fabbot#18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI is currently red on PHP 8.1 to 8.4 (see #1106), and Fabbot fails on every PR that touches a test file. This PR fixes both, as well as the other issues reported by PHPUnit.
CI failure
Composer's
Filesystemnow callsstat()on the target file when writing it, throughSilencer. PHPUnit only considers errors silenced with@as suppressed, so it reports it, andfailOnWarningmakes the build fail. This test only checks the lock in memory, so it now usesnew Lock('php://memory'), whichJsonFilewrites without touching the disk (supported since Composer 2.1).Other PHPUnit issues
with()did not check anything anymore (ScriptExecutorTest::testMemoryLimitwas not testing anything). They are mocks withexpects($this->once())again;createStub()is used instead;RecipePatcherTest.Tested with PHPUnit 10, 11 and 12.
Fabbot
Fabbot's PHP-CS-Fixer step adds
: voidto test methods (void_returnfrom@Symfony:risky), while its next step requires test methods not to have a return type. The PHP-CS-Fixer config now disablesvoid_returnintests/, like symfony/symfony does.