Skip to content

[9.x] Improve typing on user factory #5806

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
Feb 9, 2022
Merged

[9.x] Improve typing on user factory #5806

merged 1 commit into from
Feb 9, 2022

Conversation

axlon
Copy link
Contributor

@axlon axlon commented Feb 9, 2022

This fixes some PHPStan issues in the user factory (I tested at level 8)

 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   database/factories/UserFactory.php                                                                                                                                    
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  18     Method Database\Factories\UserFactory::definition() return type has no value type specified in iterable type array.                                                   
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                                                              
  34     Method Database\Factories\UserFactory::unverified() return type with generic class Illuminate\Database\Eloquent\Factories\Factory does not specify its types: TModel  
         💡 You can turn this off by setting checkGenericClassInNonGenericObjectType: false in your phpstan.neon.dist.                                                          
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------

@nunomaduro nunomaduro merged commit a49d1c2 into laravel:9.x Feb 9, 2022
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.

2 participants