laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Fix model factory method arguments for Laravel >= 9

Open wimski opened this issue 2 years ago • 0 comments

Summary

The arguments for HasFactory::factory have changed since Laravel 9, so the docblocks have to be changed accordingly.

https://github.com/laravel/framework/commit/0f0f883cc181c7ccdcf4b9eb740c796e0944e696

In order to test this change, you will need Laravel 9, which will not install because of conflicting/limiting dependencies. I tested it by changing the following dependencies:

  • friendsofphp/php-cs-fixer from ^2 to ^2 || ^3
  • vimeo/psalm from ^3.12 to ^3.12 || ^4

Updating these packages will open such a can of worms, that I didn't include these updates in this PR.

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)

Checklist

  • [x] Existing tests have been adapted and/or new tests have been added
  • [x] Add a CHANGELOG.md entry
  • [ ] Code style has been fixed via composer fix-style

Code style fixing cannot be done with PHP 8.1. Another reason friendsofphp/php-cs-fixer should be updated to ^3.

PHP needs to be a minimum version of PHP 5.6.0 and maximum version of PHP 8.0.*.

wimski avatar Jul 06 '22 12:07 wimski