Skip to content

Conversation

LukeTowers
Copy link
Contributor

@LukeTowers LukeTowers commented Jul 23, 2025

Fixes #56152 which was caused by the incorrect parameters being used for a more specific type hint docblock merged in #55687.

This currently causes issues with projects that use static analysis and make use of the $builder->blueprintResolver() method to resolve custom blueprints.

See https://github.com/LukeTowers/framework/blob/patch-1/src/Illuminate/Database/Schema/Builder.php#L621-L637 for the proof of the corrected typehints.

Example below:

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   Database/DatabaseServiceProvider.php                                                                      
 ------ ---------------------------------------------------------------------------------------------------------- 
  :109   Parameter #1 $connection of class Winter\Storm\Database\Schema\Blueprint constructor expects              
         Illuminate\Database\Connection, string given.                                                             
         🪪  argument.type                                                                                         
  :109   Parameter #2 $table of class Winter\Storm\Database\Schema\Blueprint constructor expects string, Closure   
         given.                                                                                                    
         🪪  argument.type                                                                                         
  :109   Parameter #3 $callback of class Winter\Storm\Database\Schema\Blueprint constructor expects Closure|null,  
         string given.                                                                                             
         🪪  argument.type                                                                                         
 ------ ----------------------------------------------------------------------------------------------------------

Fixes laravel#56152 which was caused by the incorrect parameters being used for a more specific type hint docblock merged in laravel#55687. 

This currently causes issues with projects that use static analysis and make use of the $builder->blueprintResolver() method to resolve custom blueprints.

Example below:

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   Database/DatabaseServiceProvider.php                                                                      
 ------ ---------------------------------------------------------------------------------------------------------- 
  :109   Parameter laravel#1 $connection of class Winter\Storm\Database\Schema\Blueprint constructor expects              
         Illuminate\Database\Connection, string given.                                                             
         🪪  argument.type                                                                                         
  :109   Parameter laravel#2 $table of class Winter\Storm\Database\Schema\Blueprint constructor expects string, Closure   
         given.                                                                                                    
         🪪  argument.type                                                                                         
  :109   Parameter laravel#3 $callback of class Winter\Storm\Database\Schema\Blueprint constructor expects Closure|null,  
         string given.                                                                                             
         🪪  argument.type                                                                                         
 ------ ----------------------------------------------------------------------------------------------------------
@LukeTowers
Copy link
Contributor Author

@crynobone I've submitted a PR to fix #56152 as requested.

LukeTowers added a commit to wintercms/storm that referenced this pull request Jul 23, 2025
@taylorotwell taylorotwell merged commit ec3da53 into laravel:12.x Jul 23, 2025
60 checks passed
@LukeTowers LukeTowers deleted the patch-1 branch July 23, 2025 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

blueprintResolver type mismatch

2 participants