tighten / duster

Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards.
MIT License
464 stars 13 forks source link

argument (User $user = null) should be (?User $user = null) ? #128

Closed BadChoice closed 11 months ago

BadChoice commented 11 months ago

Hello, Our team has been discussing this rule that makes duster to fail when we declare a nullable type of an default null type.

We believe the second form is the correct, since the type is a nullable user, however we understand that there are cases that the first form makes sense, but it is not a good architecture

Is there any reason why duster defaults to the first form, and is there any way to force the second one?

Thanks!

driftingly commented 11 months ago

We use Pint under the hood for a lot of default preferences, this is something it brings in from the Pint Laravel Preset

https://cs.symfony.com/doc/rules/function_notation/nullable_type_declaration_for_default_null_value.html#example-2