Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Revert "[12.x] Make Blueprint Resolver Statically" #55690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "Make Blueprint Resolver Statically (#55607)"
This reverts commit ea9c481.
  • Loading branch information
taylorotwell authored May 9, 2025
commit 9ef14f691ed8544efdb0fa7ad50d260f25388c26
17 changes: 7 additions & 10 deletions 17 src/Illuminate/Database/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
use InvalidArgumentException;
use LogicException;

/**
* @template TResolver of \Closure(string, \Closure, string): \Illuminate\Database\Schema\Blueprint
*/
class Builder
{
use Macroable;
Expand All @@ -33,9 +30,9 @@ class Builder
/**
* The Blueprint resolver callback.
*
* @var TResolver|null
* @var \Closure
*/
protected static $resolver = null;
protected $resolver;

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

if (static::$resolver !== null) {
return call_user_func(static::$resolver, $connection, $table, $callback);
if (isset($this->resolver)) {
return call_user_func($this->resolver, $connection, $table, $callback);
}

return Container::getInstance()->make(Blueprint::class, compact('connection', 'table', 'callback'));
Expand Down Expand Up @@ -701,11 +698,11 @@ public function getConnection()
/**
* Set the Schema Blueprint resolver callback.
*
* @param TResolver|null $resolver
* @param \Closure $resolver
* @return void
*/
public function blueprintResolver(?Closure $resolver)
public function blueprintResolver(Closure $resolver)
{
static::$resolver = $resolver;
$this->resolver = $resolver;
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.