Skip to content

Commit

Permalink
Replace array_merge() with array spread operators
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Aug 4, 2024
1 parent 9936f81 commit 9467b87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/php/lang/ast/syntax/PHP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function __construct() {
$parse->forward();
$skipped[]= $parse->token;
}
$parse->queue= $parse->queue ? array_merge($skipped, $parse->queue) : $skipped;
$parse->queue= $parse->queue ? [...$skipped, ...$parse->queue] : $skipped;

if ($cast && ('operator' !== $parse->token->kind || '(' === $parse->token->value || '[' === $parse->token->value)) {
$parse->forward();
Expand Down Expand Up @@ -507,7 +507,7 @@ public function __construct() {
}
}

$parse->queue= $parse->queue ? array_merge($skipped, $parse->queue) : $skipped;
$parse->queue= $parse->queue ? [...$skipped, ...$parse->queue] : $skipped;
if ($generic) {
$parse->token= $token;
return $this->type($parse, false);
Expand Down

0 comments on commit 9467b87

Please sign in to comment.