Skip to content
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 Linter #5

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@faustbrian
Copy link
Owner

faustbrian commented Mar 1, 2019

This pull request includes changes and recommendations for crafting your application "The Laravel Way". Feel free to commit any additional changes to the shift-12412 branch.

Before merging, you should:

  • Checkout the shift-12412 branch
  • Review all pull request comments for additional changes
  • Thoroughly test your application

If you want help with your upgrade, check out the Shift Human Services or join the Shifty Coders Slack room to get answers to all your Laravel questions.

@faustbrian

This comment has been minimized.

Copy link
Owner Author

faustbrian commented Mar 1, 2019

⚠️ Shift found instances of string based class references. Laravel adopted the ::class static property since it became available in PHP 5.5. You should update your code to use references like App\SomeModel::class instead of strings like 'App\SomeModel'.

@faustbrian

This comment has been minimized.

Copy link
Owner Author

faustbrian commented Mar 1, 2019

⚠️ The following controllers contain actions outside of the 7 resource actions (index, create, store, show, edit, update, destroy). For more details, review the docs or watch Cruddy by Design to see if you can rework these into resource controllers.

  • app/Http/Controllers/API/DisbursementController.php
  • app/Http/Controllers/API/WalletController.php
  • app/Http/Controllers/Account/Settings/Profile/ContactInformationController.php
  • app/Http/Controllers/Account/Settings/Security/PasswordController.php
  • app/Http/Controllers/Account/Settings/Security/TwoFactorAuthController.php
  • app/Http/Controllers/Auth/ImpersonationController.php
  • app/Http/Controllers/Auth/LoginController.php
  • app/Http/Controllers/Auth/MagicLoginController.php
  • app/Http/Controllers/Auth/TwoFactor/EmergencyLoginController.php
  • app/Http/Controllers/Auth/TwoFactor/LoginController.php
  • app/Http/Controllers/Dashboard/DisbursementController.php
  • app/Http/Controllers/Dashboard/LostAndFoundController.php
  • app/Http/Controllers/Dashboard/NotificationController.php
  • app/Http/Controllers/Dashboard/WalletController.php
  • app/Http/Controllers/Front/AnnouncementController.php
  • app/Http/Controllers/Front/BlockController.php
  • app/Http/Controllers/Front/DisbursementController.php
  • app/Http/Controllers/Front/PageController.php
  • app/Http/Controllers/Front/ReportController.php
  • app/Http/Controllers/Front/WalletController.php
@faustbrian

This comment has been minimized.

Copy link
Owner Author

faustbrian commented Mar 1, 2019

⚠️ Shift found inline validation in the following controllers. Unless you require this level of control, you should use a Form Request to encapsulate this validation logic and keep your controller clean.

  • app/Http/Controllers/Auth/MagicLoginController.php
  • app/Http/Controllers/Auth/RegisterController.php
  • app/Http/Controllers/Auth/TwoFactor/EmergencyLoginController.php
  • app/Http/Controllers/Auth/TwoFactor/LoginController.php
  • app/Http/Controllers/Dashboard/LostAndFoundController.php
  • app/Http/Controllers/Dashboard/WalletController.php
@faustbrian

This comment has been minimized.

Copy link
Owner Author

faustbrian commented Mar 1, 2019

Shift could not run composer install for your application. As such, the analysis for lines of code are unavailable.

@faustbrian

This comment has been minimized.

Copy link
Owner Author

faustbrian commented Mar 1, 2019

⚠️ Shift found the following config files differ from the defaults. While you are welcome to customize your configuration, you should leverage ENV variables rather than hardcode values. If you find you're adding a lot of configuration options, consider creating a domain specific config file, such as core.php. Both will make app upgrades and deployments easier.

  • config/app.php
  • config/auth.php
  • config/broadcasting.php
  • config/cache.php
  • config/database.php
  • config/filesystems.php
  • config/hashing.php
  • config/logging.php
  • config/mail.php
  • config/queue.php
  • config/services.php
  • config/session.php
  • config/view.php
@faustbrian

This comment has been minimized.

Copy link
Owner Author

faustbrian commented Mar 1, 2019

ℹ️ As noted, much of the code detected above can be automatically fixed using the Laravel Fixer. Save yourself time and clean up your codebase quickly with this new Shift.

@faustbrian faustbrian closed this Mar 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.