File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use Nette \Utils \Strings ;
66use PHPStan \Analyser \OutOfClassScope ;
7+ use PHPStan \DependencyInjection \BleedingEdgeToggle ;
78use PHPStan \Internal \CombinationsHelper ;
89use PHPStan \Php \PhpVersion ;
910use PHPStan \PhpDocParser \Ast \ConstExpr \ConstExprIntegerNode ;
@@ -563,7 +564,11 @@ public function findTypeAndMethodNames(): array
563564 continue ;
564565 }
565566
566- if ($ has ->yes () && !$ phpVersion ->supportsCallableInstanceMethods ()) {
567+ if (
568+ BleedingEdgeToggle ::isBleedingEdge ()
569+ && $ has ->yes ()
570+ && !$ phpVersion ->supportsCallableInstanceMethods ()
571+ ) {
567572 $ methodReflection = $ type ->getMethod ($ method ->getValue (), new OutOfClassScope ());
568573 if ($ classOrObject ->isString ()->yes () && !$ methodReflection ->isStatic ()) {
569574 continue ;
Original file line number Diff line number Diff line change 66use Nette \Utils \Strings ;
77use PhpParser \Node \Name ;
88use PHPStan \Analyser \OutOfClassScope ;
9+ use PHPStan \DependencyInjection \BleedingEdgeToggle ;
910use PHPStan \PhpDocParser \Ast \ConstExpr \QuoteAwareConstExprStringNode ;
1011use PHPStan \PhpDocParser \Ast \Type \ConstTypeNode ;
1112use PHPStan \PhpDocParser \Ast \Type \TypeNode ;
@@ -212,7 +213,11 @@ public function isCallable(): TrinaryLogic
212213 $ classRef = $ reflectionProvider ->getClass ($ matches [1 ]);
213214 if ($ classRef ->hasMethod ($ matches [2 ])) {
214215 $ method = $ classRef ->getMethod ($ matches [2 ], new OutOfClassScope ());
215- if (!$ phpVersion ->supportsCallableInstanceMethods () && !$ method ->isStatic ()) {
216+ if (
217+ BleedingEdgeToggle ::isBleedingEdge ()
218+ && !$ phpVersion ->supportsCallableInstanceMethods ()
219+ && !$ method ->isStatic ()
220+ ) {
216221 return TrinaryLogic ::createNo ();
217222 }
218223
You can’t perform that action at this time.
0 commit comments