Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OtherMethodQueryBuilderParser: prevent broken type infering with partial analysis #504

Open
wants to merge 2 commits into
base: 1.3.x
Choose a base branch
from
Open
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
17 changes: 16 additions & 1 deletion extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ conditionalTags:
phpstan.broker.methodsClassReflectionExtension: %doctrine.allCollectionsSelectable%

services:
otherMethodAnalysisParser: # identical to defaultAnalysisParser, but uses inner PathRoutingParser without cleaning parser
class: PHPStan\Parser\CachedParser
arguments:
originalParser: @pathRoutingOtherMethodAnalysisParser
cachedNodesByStringCountMax: %cache.nodesByStringCountMax%
autowired: false

pathRoutingOtherMethodAnalysisParser: # identical to pathRoutingParser, but no cleaning parser is used
janedbal marked this conversation as resolved.
Show resolved Hide resolved
class: PHPStan\Parser\PathRoutingParser
arguments:
currentPhpVersionRichParser: @currentPhpVersionRichParser
currentPhpVersionSimpleParser: @currentPhpVersionRichParser
php8Parser: @php8Parser
autowired: false

-
class: PHPStan\Type\Doctrine\DescriptorRegistryFactory
-
Expand Down Expand Up @@ -164,7 +179,7 @@ services:
class: PHPStan\Type\Doctrine\QueryBuilder\OtherMethodQueryBuilderParser
arguments:
descendIntoOtherMethods: %doctrine.searchOtherMethodsForQueryBuilderBeginning%
parser: @defaultAnalysisParser
parser: @otherMethodAnalysisParser

-
class: PHPStan\Stubs\Doctrine\StubFilesExtensionLoader
Expand Down