File tree Expand file tree Collapse file tree 3 files changed +74
-1
lines changed Expand file tree Collapse file tree 3 files changed +74
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ parameters:
3838 - stubs/Collections/ArrayCollection.stub
3939 - stubs/Collections/Collection.stub
4040 - stubs/Collections/Selectable.stub
41- - stubs/ORM/QueryBuilder.stub
4241 - stubs/ORM/AbstractQuery.stub
4342 - stubs/ORM/Mapping/ClassMetadata.stub
4443 - stubs/ORM/Mapping/ClassMetadataInfo.stub
@@ -151,6 +150,13 @@ services:
151150 descendIntoOtherMethods : %doctrine.searchOtherMethodsForQueryBuilderBeginning%
152151 parser : @defaultAnalysisParser
153152
153+ -
154+ class : PHPStan\Stubs\Doctrine\StubFilesExtensionLoader
155+ tags :
156+ - phpstan.stubFilesExtension
157+ arguments :
158+ bleedingEdge : %featureToggles.bleedingEdge%
159+
154160 doctrineQueryBuilderArgumentsProcessor :
155161 class : PHPStan\Type\Doctrine\ArgumentsProcessor
156162 autowired : false
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace PHPStan \Stubs \Doctrine ;
4+
5+ use PHPStan \PhpDoc \StubFilesExtension ;
6+ use function dirname ;
7+
8+ class StubFilesExtensionLoader implements StubFilesExtension
9+ {
10+
11+ /** @var bool */
12+ private $ bleedingEdge ;
13+
14+ public function __construct (
15+ bool $ bleedingEdge
16+ )
17+ {
18+ $ this ->bleedingEdge = $ bleedingEdge ;
19+ }
20+
21+ public function getFiles (): array
22+ {
23+ $ path = dirname (dirname (dirname (__DIR__ ))) . '/stubs ' ;
24+
25+ if ($ this ->bleedingEdge === true ) {
26+ $ path .= '/bleedingEdge ' ;
27+ }
28+
29+ return [
30+ $ path . '/ORM/QueryBuilder.stub ' ,
31+ ];
32+ }
33+
34+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Doctrine\ORM;
4+
5+ class QueryBuilder
6+ {
7+
8+ /**
9+ * @return Query<mixed>
10+ */
11+ public function getQuery()
12+ {
13+ }
14+
15+ /**
16+ * @param \Doctrine\Common\Collections\ArrayCollection<array-key, mixed>|array<mixed> $parameters
17+ * @return static
18+ */
19+ public function setParameters($parameters)
20+ {
21+
22+ }
23+
24+ /**
25+ * @param literal-string|object|array<mixed> $predicates
26+ * @return $this
27+ */
28+ public function where($predicates)
29+ {
30+
31+ }
32+
33+ }
You can’t perform that action at this time.
0 commit comments