File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 14
14
use PHPStan \Type \MixedType ;
15
15
use PHPStan \Type \NeverType ;
16
16
use PHPStan \Type \NullType ;
17
+ use PHPStan \Type \ObjectType ;
17
18
use PHPStan \Type \ObjectWithoutClassType ;
18
19
use PHPStan \Type \StaticType ;
19
20
use PHPStan \Type \StrictMixedType ;
@@ -497,7 +498,15 @@ private function findTypeToCheckImplementation(
497
498
}
498
499
499
500
$ tip = null ;
500
- if (str_contains ($ type ->describe (VerbosityLevel::typeOnly ()), 'PhpParser \\Node \\Arg|PhpParser \\Node \\VariadicPlaceholder ' ) && !$ unionTypeCriteriaCallback ($ type )) {
501
+ if (
502
+ $ type instanceof UnionType
503
+ && count ($ type ->getTypes ()) === 2
504
+ && $ type ->getTypes ()[0 ] instanceof ObjectType
505
+ && $ type ->getTypes ()[1 ] instanceof ObjectType
506
+ && $ type ->getTypes ()[0 ]->getClassName () === 'PhpParser \\Node \\Arg '
507
+ && $ type ->getTypes ()[1 ]->getClassName () === 'PhpParser \\Node \\VariadicPlaceholder '
508
+ && !$ unionTypeCriteriaCallback ($ type )
509
+ ) {
501
510
$ tip = 'Use <fg=cyan>->getArgs()</> instead of <fg=cyan>->args</>. ' ;
502
511
}
503
512
You can’t perform that action at this time.
0 commit comments