File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1414use PHPStan \Type \MixedType ;
1515use PHPStan \Type \NeverType ;
1616use PHPStan \Type \NullType ;
17+ use PHPStan \Type \ObjectType ;
1718use PHPStan \Type \ObjectWithoutClassType ;
1819use PHPStan \Type \StaticType ;
1920use PHPStan \Type \StrictMixedType ;
@@ -497,7 +498,15 @@ private function findTypeToCheckImplementation(
497498 }
498499
499500 $ 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+ ) {
501510 $ tip = 'Use <fg=cyan>->getArgs()</> instead of <fg=cyan>->args</>. ' ;
502511 }
503512
You can’t perform that action at this time.
0 commit comments