Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ final class SkipChainedCalls
{
public function run()
{
function ($foo)
{
return FooBar::foo()->bar($foo);
};

fn ($foo) => FooBar::foo()->bar($foo);
fn ($foo) => FooBar::foo()::bar($foo);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,13 @@ private function isUsingNamedArgs(array $args): bool

private function isChainedCall(FuncCall|MethodCall|StaticCall $callLike): bool
{
if (! $callLike instanceof MethodCall) {
return false;
if ($callLike instanceof MethodCall) {
return $callLike->var instanceof CallLike;
} elseif ($callLike instanceof StaticCall) {
return $callLike->class instanceof CallLike;
}

return $callLike->var instanceof CallLike;
return false;
}

/**
Expand Down