Skip to content

Commit fcf0561

Browse files
staabmVincentLanglet
authored andcommitted
Introduce isDummy
1 parent 8717c5d commit fcf0561

19 files changed

Lines changed: 118 additions & 2 deletions

src/Reflection/Annotations/AnnotationMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
194194
return null;
195195
}
196196

197+
public function isDummy(): TrinaryLogic
198+
{
199+
return TrinaryLogic::createNo();
200+
}
201+
197202
}

src/Reflection/Dummy/ChangedTypeMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
183183
return $this->reflection->getResolvedPhpDoc();
184184
}
185185

186+
public function isDummy(): TrinaryLogic
187+
{
188+
return $this->reflection->isDummy();
189+
}
190+
186191
}

src/Reflection/Dummy/DummyConstructorReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
169169
return null;
170170
}
171171

172+
public function isDummy(): TrinaryLogic
173+
{
174+
return TrinaryLogic::createYes();
175+
}
176+
172177
}

src/Reflection/Dummy/DummyMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
161161
return null;
162162
}
163163

164+
public function isDummy(): TrinaryLogic
165+
{
166+
return TrinaryLogic::createYes();
167+
}
168+
164169
}

src/Reflection/ExtendedMethodReflection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,11 @@ public function mustUseReturnValue(): TrinaryLogic;
8080

8181
public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock;
8282

83+
/**
84+
* Returns yes() for methods that represent possibly-defined method
85+
* on non-final classes, mixed, object, etc. — placeholders PHPStan creates
86+
* when it cannot prove a method doesn't exist.
87+
*/
88+
public function isDummy(): TrinaryLogic;
89+
8390
}

src/Reflection/Native/NativeMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
243243
return $this->resolvedPhpDocBlock;
244244
}
245245

246+
public function isDummy(): TrinaryLogic
247+
{
248+
return TrinaryLogic::createNo();
249+
}
250+
246251
}

src/Reflection/Php/ClosureCallMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
213213
return $this->nativeMethodReflection->getResolvedPhpDoc();
214214
}
215215

216+
public function isDummy(): TrinaryLogic
217+
{
218+
return TrinaryLogic::createNo();
219+
}
220+
216221
}

src/Reflection/Php/EnumCasesMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
172172
return null;
173173
}
174174

175+
public function isDummy(): TrinaryLogic
176+
{
177+
return TrinaryLogic::createNo();
178+
}
179+
175180
}

src/Reflection/Php/PhpMethodFromParserNodeReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
303303
return $this->resolvedPhpDoc;
304304
}
305305

306+
public function isDummy(): TrinaryLogic
307+
{
308+
return TrinaryLogic::createNo();
309+
}
310+
306311
}

src/Reflection/Php/PhpMethodReflection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,4 +485,9 @@ public function getResolvedPhpDoc(): ?ResolvedPhpDocBlock
485485
return $this->resolvedPhpDocBlock;
486486
}
487487

488+
public function isDummy(): TrinaryLogic
489+
{
490+
return TrinaryLogic::createNo();
491+
}
492+
488493
}

0 commit comments

Comments
 (0)