Skip to content

Commit ce4e824

Browse files
committed
Remove assert() on CallLike::getArgs(), returns empty array on first class callable
1 parent 8c360e2 commit ce4e824

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/PhpParser/Node/Expr/CallLike.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ public function isFirstClassCallable(): bool {
2424
}
2525

2626
/**
27-
* Assert that this is not a first-class callable and return only ordinary Args.
27+
* Return only ordinary Args.
2828
*
2929
* @return Arg[]
3030
*/
3131
public function getArgs(): array {
32-
assert(!$this->isFirstClassCallable());
32+
if ($this->isFirstClassCallable()) {
33+
return [];
34+
}
3335
return $this->getRawArgs();
3436
}
3537

0 commit comments

Comments
 (0)