99use InvalidArgumentException ;
1010use LogicException ;
1111
12- /**
13- * @template TResolver of \Closure(string, \Closure, string): \Illuminate\Database\Schema\Blueprint
14- */
1512class 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