Skip to content

Commit ff91d09

Browse files
authored
simplify passing arguments to when() (#53815)
the `when()` method accepts 3 parameters. we can just pass 3 arguments rather than putting them into an array, and then spreading them.
1 parent 75e64fe commit ff91d09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
416416

417417
return $this->when(
418418
$this->hasPivotLoadedAs($accessor, $table),
419-
...[$value, $default]
419+
$value,
420+
$default,
420421
);
421422
}
422423

0 commit comments

Comments
 (0)