Skip to content

[PHPStan 2.1.18] Fix NeonAdapter construct on MaximumIgnoredErrorCountRule - #231

Merged
samsonasik merged 3 commits into
mainfrom
test-instantiate-phpstan-2118
Jul 17, 2025
Merged

[PHPStan 2.1.18] Fix NeonAdapter construct on MaximumIgnoredErrorCountRule#231
samsonasik merged 3 commits into
mainfrom
test-instantiate-phpstan-2118

Conversation

@samsonasik

@samsonasik samsonasik commented Jul 17, 2025

Copy link
Copy Markdown
Member

There is no existing test for MaximumIgnoredErrorCountRule as this test against getcwd() . '/phpstan.neon'

$configFilePath = getcwd() . '/phpstan.neon';

so I added crash test for it, that cause error:

There was 1 error:

1) Symplify\PHPStanRules\Tests\Issues\InstantiateMaximumIgnoredErrorCountRuleTest::testInstantiation
ArgumentCountError: Too few arguments to function PHPStan\DependencyInjection\NeonAdapter::__construct(), 0 passed in /Users/samsonasik/www/phpstan-rules/src/Rules/MaximumIgnoredErrorCountRule.php on line 30 and exactly 1 expected

phar:///Users/samsonasik/www/phpstan-rules/vendor/phpstan/phpstan/phpstan.phar/src/DependencyInjection/NeonAdapter.php:43
/Users/samsonasik/www/phpstan-rules/src/Rules/MaximumIgnoredErrorCountRule.php:30
/Users/samsonasik/www/phpstan-rules/tests/Issues/InstantiateMaximumIgnoredErrorCountRuleTest.php:13

Fixes #230

@samsonasik

Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba it needs immediate merge and release, so rector can bump requirement and then regenerate preload.

@samsonasik
samsonasik merged commit d49aff7 into main Jul 17, 2025
6 checks passed
@samsonasik
samsonasik deleted the test-instantiate-phpstan-2118 branch July 17, 2025 19:03
@samsonasik

Copy link
Copy Markdown
Member Author

@samsonasik

Copy link
Copy Markdown
Member Author

wait for new rector release for PR:

so real downgrade can apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHPStan 2.1.18 cause error Too few arguments to function PHPStan\DependencyInjection\NeonAdapter::__construct()

1 participant