9
9
use InvalidArgumentException ;
10
10
use LogicException ;
11
11
12
- /**
13
- * @template TResolver of \Closure(string, \Closure, string): \Illuminate\Database\Schema\Blueprint
14
- */
15
12
class Builder
16
13
{
17
14
use Macroable;
@@ -33,9 +30,9 @@ class Builder
33
30
/**
34
31
* The Blueprint resolver callback.
35
32
*
36
- * @var TResolver|null
33
+ * @var \Closure
37
34
*/
38
- protected static $ resolver = null ;
35
+ protected $ resolver ;
39
36
40
37
/**
41
38
* The default string length for migrations.
@@ -632,8 +629,8 @@ protected function createBlueprint($table, ?Closure $callback = null)
632
629
{
633
630
$ connection = $ this ->connection ;
634
631
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 );
637
634
}
638
635
639
636
return Container::getInstance ()->make (Blueprint::class, compact ('connection ' , 'table ' , 'callback ' ));
@@ -701,11 +698,11 @@ public function getConnection()
701
698
/**
702
699
* Set the Schema Blueprint resolver callback.
703
700
*
704
- * @param TResolver|null $resolver
701
+ * @param \Closure $resolver
705
702
* @return void
706
703
*/
707
- public function blueprintResolver (? Closure $ resolver )
704
+ public function blueprintResolver (Closure $ resolver )
708
705
{
709
- static :: $ resolver = $ resolver ;
706
+ $ this -> resolver = $ resolver ;
710
707
}
711
708
}
0 commit comments