Skip to content

Upgrade Checker #151

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 14, 2021
Merged

Upgrade Checker #151

merged 1 commit into from
Feb 14, 2021

Conversation

LavaToaster
Copy link
Member

This pull request contains changes and comments noting incompatible or deprecated code by the Upgrade Checker. You should review each comment and commit changes to the shift-40783 branch before merging.

If you need help with your upgrade, check out the Human Shifts. You may also join the Shifty Coders Slack workspace to level-up your Laravel skills.

Laravel 5 added several new helper functions, including:

- `view()`
- `response()`
- `redirect()`
- `config()`
- `abort()`

Review the [helpers][1] documentation for more details.

[1]: https://laravel.com/docs/5.0/helpers
@LavaToaster
Copy link
Member Author

⚠️ Laravel 5.8 correctly pluralizes multi-word model names ending in a word with an irregular pluralization. For example, Laravel 5.7 pluralized the table name for the UserFeedback model as user_feedbacks. Starting with Laravel 5.8, the table for the UserFeedback model is correctly pluralized as user_feedback.

If your tables were named using this irregular pluralization, you should rename your table or set the $table property for your model. If you were overriding this incorrect behavior by setting the $table property, you may remove it and now rely on the framework.

@LavaToaster
Copy link
Member Author

⚠️ Shift found potential uses of the email validation rule. In Laravel 5.8, the default validation for this rule changed to be inline with the RFC. As such, it allows alternative formats like someone@domain.

If you wish to preserve the original behavior, you may use email:filter instead.

@LavaToaster
Copy link
Member Author

❌ The following PHP classes are missing a namespace. Laravel 5 added namespacing for all classes within app/.

  • app/Library/Assets.php
  • app/Library/AudioCache.php
  • app/Library/External.php
  • app/Library/File.php
  • app/Library/Gravatar.php
  • app/Library/Helpers.php
  • app/Library/PfmValidator.php
  • app/Library/ZipStream.php
  • app/Library/getid3/demos/demo.audioinfo.class.php
  • app/Library/getid3/demos/getid3.demo.dirscan.php
  • app/Library/getid3/getid3/extension.cache.dbm.php
  • app/Library/getid3/getid3/extension.cache.mysql.php
  • app/Library/getid3/getid3/extension.cache.mysqli.php
  • app/Library/getid3/getid3/extension.cache.sqlite3.php
  • app/Library/getid3/getid3/getid3.lib.php
  • app/Library/getid3/getid3/getid3.php
  • app/Library/getid3/getid3/module.archive.gzip.php
  • app/Library/getid3/getid3/module.archive.rar.php
  • app/Library/getid3/getid3/module.archive.szip.php
  • app/Library/getid3/getid3/module.archive.tar.php
  • app/Library/getid3/getid3/module.archive.zip.php
  • app/Library/getid3/getid3/module.audio-video.asf.php
  • app/Library/getid3/getid3/module.audio-video.bink.php
  • app/Library/getid3/getid3/module.audio-video.flv.php
  • app/Library/getid3/getid3/module.audio-video.matroska.php
  • app/Library/getid3/getid3/module.audio-video.mpeg.php
  • app/Library/getid3/getid3/module.audio-video.nsv.php
  • app/Library/getid3/getid3/module.audio-video.quicktime.php
  • app/Library/getid3/getid3/module.audio-video.real.php
  • app/Library/getid3/getid3/module.audio-video.riff.php
  • app/Library/getid3/getid3/module.audio-video.swf.php
  • app/Library/getid3/getid3/module.audio-video.ts.php
  • app/Library/getid3/getid3/module.audio.aa.php
  • app/Library/getid3/getid3/module.audio.aac.php
  • app/Library/getid3/getid3/module.audio.ac3.php
  • app/Library/getid3/getid3/module.audio.amr.php
  • app/Library/getid3/getid3/module.audio.au.php
  • app/Library/getid3/getid3/module.audio.avr.php
  • app/Library/getid3/getid3/module.audio.bonk.php
  • app/Library/getid3/getid3/module.audio.dsf.php
  • app/Library/getid3/getid3/module.audio.dss.php
  • app/Library/getid3/getid3/module.audio.dts.php
  • app/Library/getid3/getid3/module.audio.flac.php
  • app/Library/getid3/getid3/module.audio.la.php
  • app/Library/getid3/getid3/module.audio.lpac.php
  • app/Library/getid3/getid3/module.audio.midi.php
  • app/Library/getid3/getid3/module.audio.mod.php
  • app/Library/getid3/getid3/module.audio.monkey.php
  • app/Library/getid3/getid3/module.audio.mp3.php
  • app/Library/getid3/getid3/module.audio.mpc.php
  • app/Library/getid3/getid3/module.audio.ogg.php
  • app/Library/getid3/getid3/module.audio.optimfrog.php
  • app/Library/getid3/getid3/module.audio.rkau.php
  • app/Library/getid3/getid3/module.audio.shorten.php
  • app/Library/getid3/getid3/module.audio.tta.php
  • app/Library/getid3/getid3/module.audio.voc.php
  • app/Library/getid3/getid3/module.audio.vqf.php
  • app/Library/getid3/getid3/module.audio.wavpack.php
  • app/Library/getid3/getid3/module.graphic.bmp.php
  • app/Library/getid3/getid3/module.graphic.efax.php
  • app/Library/getid3/getid3/module.graphic.gif.php
  • app/Library/getid3/getid3/module.graphic.jpg.php
  • app/Library/getid3/getid3/module.graphic.pcd.php
  • app/Library/getid3/getid3/module.graphic.png.php
  • app/Library/getid3/getid3/module.graphic.svg.php
  • app/Library/getid3/getid3/module.graphic.tiff.php
  • app/Library/getid3/getid3/module.misc.cue.php
  • app/Library/getid3/getid3/module.misc.exe.php
  • app/Library/getid3/getid3/module.misc.iso.php
  • app/Library/getid3/getid3/module.misc.msoffice.php
  • app/Library/getid3/getid3/module.misc.par2.php
  • app/Library/getid3/getid3/module.misc.pdf.php
  • app/Library/getid3/getid3/module.tag.apetag.php
  • app/Library/getid3/getid3/module.tag.id3v1.php
  • app/Library/getid3/getid3/module.tag.id3v2.php
  • app/Library/getid3/getid3/module.tag.lyrics3.php
  • app/Library/getid3/getid3/module.tag.xmp.php
  • app/Library/getid3/getid3/write.apetag.php
  • app/Library/getid3/getid3/write.id3v1.php
  • app/Library/getid3/getid3/write.id3v2.php
  • app/Library/getid3/getid3/write.lyrics3.php
  • app/Library/getid3/getid3/write.metaflac.php
  • app/Library/getid3/getid3/write.php
  • app/Library/getid3/getid3/write.real.php
  • app/Library/getid3/getid3/write.vorbiscomment.php

@LavaToaster
Copy link
Member Author

❌ Your application contains an app/Commands directory. app/Commands was renamed to app/Jobs in Laravel 5.1. You should upgrade your commands to be compatible with the latest version of Laravel.

@LavaToaster
Copy link
Member Author

ℹ️ Laravel 7 upgraded to Symfony 5 which passes instances of the Throwable interface instead of Exception instances to core components.

You should review your Handler.php and convert any uses of the Exception.

@LavaToaster
Copy link
Member Author

ℹ️ Shift detected controller namespaces being set in your RouteServiceProvider. Laravel 8 began registering controllers using static class references instead of namespace prefixes and controller names.

You may automate this conversion using the Laravel Fixer or tasks within the Shift Workbench.

@LavaToaster
Copy link
Member Author

⚠️ It appears your User model does not extend Authenticatable. Unless you have a custom User model, this could mean your class is out of date. You should should compare yours with the latest version and make any upgrades accordingly.

@LavaToaster
Copy link
Member Author

❌ Shift found references to Illuminate\Validation\Validator. This has been replaced by Illuminate\Contracts\Validation\Validator.

  • app/Commands/CommandResponse.php
  • app/Library/PfmValidator.php

@LavaToaster
Copy link
Member Author

❌ Shift found references to getToken(). This has been replaced by token().

  • app/Models/User.php

@LavaToaster
Copy link
Member Author

⚠️ Your app/Console/Kernel.php differs from the Laravel default. You should compare your app/Console/Kernel.php and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your app/Exceptions/Handler.php differs from the Laravel default. You should compare your app/Exceptions/Handler.php and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your app/Http/Controllers/Controller.php differs from the Laravel default. You should compare your app/Http/Controllers/Controller.php and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your app/Http/Kernel.php differs from the Laravel default. You should compare your app/Http/Kernel.php and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your artisan differs from the Laravel default. You should compare your artisan and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your bootstrap/app.php differs from the Laravel default. You should compare your bootstrap/app.php and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your phpunit.xml differs from the Laravel default. You should compare your phpunit.xml and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your public/.htaccess differs from the Laravel default. You should compare your public/.htaccess and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

⚠️ Your public/index.php differs from the Laravel default. You should compare your public/index.php and with the latest version and make any updates.

@LavaToaster
Copy link
Member Author

❌ The following configuration files differ from the Laravel defaults. If you are modifying configuration values directly, consider using an environment variable instead to keep these files maintainable. You should compare your configuration files against the latest version and make any updates.

  • 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

@LavaToaster
Copy link
Member Author

❌ The container's make method no longer accepts a second parameter to pass arguments into the container in Laravel 5.4. Ideally, you should construct this object through the container or registering a callback.

However, this functionality was reintroduced by the makeWith method instead. Shift converted these calls to makeWith. But you will need to manually update these to map the arguments to their respective constructor parameter names.

@LavaToaster
Copy link
Member Author

LavaToaster commented Feb 14, 2021

❌ In Laravel 5.4, you should define channel named placeholders using {name} style placeholders, instead of the * character as in Laravel 5.3.

Shift found potential uses of Broadcast::channel() in:

  • app/Providers/BroadcastServiceProvider.php

@LavaToaster
Copy link
Member Author

❌ Your application is missing the webpack.mix.js file. Laravel Elixir changed to Laravel Mix in Laravel 5.4 which uses Webpack, instead of Gulp.

@LavaToaster
Copy link
Member Author

LavaToaster commented Feb 14, 2021

⚠️ Previous versions of Laravel converted the second argument passed to the query builder orderBy method to desc when not set to asc. Starting with Laravel 5.8, an InvalidArgumentException is throw.

If you were attempting order by multiple columns, you should instead chain multiple calls to orderBy.

Shift detected the following uses of the orderBy() passing a second argument:

  • app/Http/Controllers/Api/Web/PlaylistsController.php
  • app/Http/Controllers/Api/Web/TracksController.php

@LavaToaster
Copy link
Member Author

ℹ️ Laravel 7 moved the Authentication components into a separate laravel/ui package, which includes the make commands as well as the traits related to authentication.

@LavaToaster
Copy link
Member Author

⚠️ Shift detected you are using the Laravel BrowserKit Testing package. Laravel changed its testing layer in Laravel 5.4. You can use the Laravel 5.4 Tests Shift to upgrade your tests to the new Laravel testing layer.

@LavaToaster
Copy link
Member Author

⚠️ The latest version of Laravel has a phpunit/phpunit requirement of ^9.3. Shift detected a constraint of ^9.3.3.

You may run the PHPUnit 9 Shift for free to automate the upgrade of your PHPUnit tests.

@LavaToaster LavaToaster merged commit e030bf2 into upgrade Feb 14, 2021
@LavaToaster LavaToaster deleted the shift-40783 branch February 14, 2021 19:44
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