Skip to content

Commit 25f7994

Browse files
committed
Variadic arguments for backward Laravel 10 & 11 and early 12 compatibility
1 parent a4aad71 commit 25f7994

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Schema/ManagesDefaultMigrations.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ public function mediumText($column, bool $hasKeyword = false, array $parameters
249249
/**
250250
* {@inheritdoc}
251251
*/
252-
public function morphs($name, $indexName = null, $after = null): void
252+
public function morphs(...$args): void
253253
{
254+
[$name] = $args;
255+
254256
$this->keyword("{$name}_type");
255257
$this->keyword("{$name}_id");
256258
}
@@ -390,17 +392,17 @@ public function unsignedTinyInteger($column, $autoIncrement = false, array $para
390392
/**
391393
* {@inheritdoc}
392394
*/
393-
public function ulidMorphs($name, $indexName = null, $after = null): void
395+
public function ulidMorphs(...$args): void
394396
{
395-
$this->morphs($name, $indexName, $after);
397+
$this->morphs(...$args);
396398
}
397399

398400
/**
399401
* {@inheritdoc}
400402
*/
401-
public function uuidMorphs($name, $indexName = null, $after = null): void
403+
public function uuidMorphs(...$args): void
402404
{
403-
$this->morphs($name, $indexName, $after);
405+
$this->morphs(...$args);
404406
}
405407

406408
/**

0 commit comments

Comments
 (0)