Skip to content

[DI] Register PHPStan PhpVersionFactory as public service so 3rd-party rules can autowire it - #8365

Merged
TomasVotruba merged 2 commits into
mainfrom
fix-entropy-autowire-nullable-scalar
Aug 24, 2026
Merged

[DI] Register PHPStan PhpVersionFactory as public service so 3rd-party rules can autowire it#8365
TomasVotruba merged 2 commits into
mainfrom
fix-entropy-autowire-nullable-scalar

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 24, 2026

Copy link
Copy Markdown
Member

No description provided.

TomasVotruba and others added 2 commits August 24, 2026 11:56
…y rules can autowire it

The entropy container autowires by reflection and throws on non-class scalar constructor params (?int $versionId, ?string $composerPhpVersion) of PHPStan\Php\PhpVersionFactory, which illuminate/container previously resolved as null. 3rd-party rules such as drupal-rector's FunctionalTestDefaultThemePropertyRector inject this service directly and broke with 'Cannot resolve parameter "versionId"'. Serve it from the PHPStan container like ReflectionProvider.
@samsonasik

Copy link
Copy Markdown
Member

For note: rector-laravel is also error due to absent of tag method

https://github.com/rectorphp/rector-src/actions/runs/32719470879/job/97407608005?pr=8365

@TomasVotruba
TomasVotruba merged commit 5fea92b into main Aug 24, 2026
49 of 51 checks passed
@TomasVotruba
TomasVotruba deleted the fix-entropy-autowire-nullable-scalar branch August 24, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants