-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Laravel Fixer #1293
Laravel Fixer #1293
Conversation
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
Laravel offers many built-in Blade directives, including: `@auth`, `@guest` ,`@csrf`, `@method`, `@json`, and more. Review the [Blade][1] documentation for more details. [1]: https://laravel.com/docs/blade
Laravel recommends using the `Str` and `Arr` class methods directly instead of the respective helper functions. These helper functions are deprecated in Laravel 5.8 and removed in Laravel 6.
Laravel automatically injects the current Http [request object][1] to all Controller actions and Middleware. Leveraging this object improves consistency and testability. [1]: https://laravel.com/docs/requests#accessing-the-request
Laravel [recommends][1] only using `env()` within configuration files and using `config()` everywhere else. Doing so allows you to improve performance by running `php artisan config:cache`. [1]: https://laravel.com/docs/5.7/configuration#configuration-caching
By convention, Laravel uses the "snake case", plural name of the class as the table name.
ℹ️ Shift noticed you have additional namespaces in your application. You may use the Consolidate Namespaces Shift to simplify your namespaces into the default Laravel |
|
You should review these instances for dynamic validation rules or custom exception handling . If you may inline these, feel free to request a rerun of this Shift.
|
ℹ️ Laravel recommends you only use Shift converted |
❌ Shift automated the conversion to fluent routes. However, some of your route groups contained unknown options. You should review the following files for any
|
ℹ️ Now with type hints in your code, defining types within PHP DocBlocks is redundant. Laravel has removed all of the |
ℹ️ While the Laravel Fixer performs automation to adopt the latest Laravel conventions, Shift understands developers have different preferences. All of Shift's automation is done in nice, atomic commits. This makes it easier to undo any of the changes Shift makes using `git revert. |
❌ PHP syntax errors were detected after running your Shift. Often these are simply differences between the PHP version on the Shift server (8.1) and your project. Occasionally they are misplaced lines or duplicate import statements. You may quickly check the PHP syntax locally by running
|
This pull request includes changes and recommendations for crafting your Laravel application. These are based on the Laravel documentation and widely adopted practices within the community.
Before merging, you need to:
shift-86725
branchDon't hesitate to send your feedback to [email protected] or share on Twitter.