AutowireLocator does not work well

Open
#440 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
php, symfony
Domain
devtools

Research direction

Start with the linked reproducer commit and the referenced Symfony discussion to reproduce how an injected ServiceLocator is interpreted. Trace the AutowireLocator handling from the relevant PHPStan Symfony extension entry point, which is not named in the issue. Done means the reproducer distinguishes a ServiceLocator from the full container and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Description

When we inject a ServiceLocator, the extension does not understand that.
It thinks it's the full container, but it's not. It's a specialed container.

I made a full reproducer:

https://github.com/lyrixx/test/commit/e172840d514a00c3ed8667e828a4197a3028c782#r154945352

(ref https://github.com/symfony/symfony/pull/60096#issuecomment-2782785035)

Dominant language
PHP
Stars
800
Forks
104
Avg merge
4m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from phpstan/phpstan-symfony

All issues in phpstan/phpstan-symfony

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.