From ce4e824d410569537b6b6673025f7c0203e60d3e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 27 Jan 2026 06:45:53 +0700 Subject: [PATCH] Remove assert() on CallLike::getArgs(), returns empty array on first class callable --- lib/PhpParser/Node/Expr/CallLike.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PhpParser/Node/Expr/CallLike.php b/lib/PhpParser/Node/Expr/CallLike.php index 86e781c102..5ea2a71ade 100644 --- a/lib/PhpParser/Node/Expr/CallLike.php +++ b/lib/PhpParser/Node/Expr/CallLike.php @@ -24,12 +24,14 @@ public function isFirstClassCallable(): bool { } /** - * Assert that this is not a first-class callable and return only ordinary Args. + * Return only ordinary Args. * * @return Arg[] */ public function getArgs(): array { - assert(!$this->isFirstClassCallable()); + if ($this->isFirstClassCallable()) { + return []; + } return $this->getRawArgs(); }