Skip to content

Commit 44cbd4b

Browse files
authored
Revert "Make Blueprint Resolver Statically (#55607)" (#55690)
This reverts commit ea9c481.
1 parent 81cd4d6 commit 44cbd4b

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/Illuminate/Database/Schema/Builder.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
use InvalidArgumentException;
1010
use LogicException;
1111

12-
/**
13-
* @template TResolver of \Closure(string, \Closure, string): \Illuminate\Database\Schema\Blueprint
14-
*/
1512
class Builder
1613
{
1714
use Macroable;
@@ -33,9 +30,9 @@ class Builder
3330
/**
3431
* The Blueprint resolver callback.
3532
*
36-
* @var TResolver|null
33+
* @var \Closure
3734
*/
38-
protected static $resolver = null;
35+
protected $resolver;
3936

4037
/**
4138
* The default string length for migrations.
@@ -632,8 +629,8 @@ protected function createBlueprint($table, ?Closure $callback = null)
632629
{
633630
$connection = $this->connection;
634631

635-
if (static::$resolver !== null) {
636-
return call_user_func(static::$resolver, $connection, $table, $callback);
632+
if (isset($this->resolver)) {
633+
return call_user_func($this->resolver, $connection, $table, $callback);
637634
}
638635

639636
return Container::getInstance()->make(Blueprint::class, compact('connection', 'table', 'callback'));
@@ -701,11 +698,11 @@ public function getConnection()
701698
/**
702699
* Set the Schema Blueprint resolver callback.
703700
*
704-
* @param TResolver|null $resolver
701+
* @param \Closure $resolver
705702
* @return void
706703
*/
707-
public function blueprintResolver(?Closure $resolver)
704+
public function blueprintResolver(Closure $resolver)
708705
{
709-
static::$resolver = $resolver;
706+
$this->resolver = $resolver;
710707
}
711708
}

0 commit comments

Comments
 (0)