-
Notifications
You must be signed in to change notification settings - Fork 144
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
Change default for nullable_type_declaration_for_default_null_value #236
Conversation
Because support for implicit support for implicit nullability exists only for backwards compatibility reasons and will be removed in the future. See laravel#235.
…behaviour Changing back after the default changed in Pint: laravel/pint#236
…efault_null_value` default (#9126) * Run Laravel Pint * Revert "Run Laravel Pint" This reverts commit 41b4476. * Revert `nullable_type_declaration_for_default_null_value` to its old behaviour Changing back after the default changed in Pint: laravel/pint#236
Something to be aware of is that it could be a breaking change, particularly in packages where someone might override one of your classes. For example: class Foo
{
- public function test(string $arg = null)
+ public function test(?string $arg = null)
{
//
}
} class Bar extends Foo
{
public function test(string $arg = null)
{
// Fatal Error:
// Declaration of Bar::test(string $arg) must be compatible with Foo::test(?string $arg)
}
} |
Tried it and I don't get a fatal: I guess PHP internally knows that there is no difference if the type is explicitly or implicitly nullable. |
@jasonvarga in your image you are missing the '= null'. |
@jasonvarga |
Ah crap. You're absolutely right. Sorry for the bother! |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [laravel/pint](https://laravel.com) ([source](https://togithub.com/laravel/pint)) | `1.13.6` -> `1.13.7` | [![age](https://developer.mend.io/api/mc/badges/age/packagist/laravel%2fpint/1.13.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/laravel%2fpint/1.13.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/laravel%2fpint/1.13.6/1.13.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/laravel%2fpint/1.13.6/1.13.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>laravel/pint (laravel/pint)</summary> ### [`v1.13.7`](https://togithub.com/laravel/pint/blob/HEAD/CHANGELOG.md#v1137---2023-12-05) [Compare Source](https://togithub.com/laravel/pint/compare/v1.13.6...v1.13.7) - Change default for nullable_type_declaration_for_default_null_value by [@​otsch](https://togithub.com/otsch) in [https://github.com/laravel/pint/pull/236](https://togithub.com/laravel/pint/pull/236) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Lapotor/RadioRoster-api). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Because support for implicit support for implicit nullability exists only for backwards compatibility reasons and will be removed in the future. See #235.