You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering something why when I generate a not-nullable field, like for example $name, the generated type is ?string and not string. This can have pretty huge impact when using tools like PHPStan since the usage of property may need additional check verification.
Is there something I miss ?
For context, I have read also this issue : #1074, but I don't see why it's still the case in 2023 in the latest version of the marker bundle.
I just thought about the case when you instantiate an entity, and you set some property using setter.
$user = newUser();
$user->setName("uwu");
So that's why you need the field to be marked as nullable, since we're setting each field one by one, not in the instantiation of the class in the constructor for example.
Hello,
I'm wondering something why when I generate a not-nullable field, like for example
$name
, the generated type is?string
and notstring
. This can have pretty huge impact when using tools like PHPStan since the usage of property may need additional check verification.Is there something I miss ?
For context, I have read also this issue : #1074, but I don't see why it's still the case in 2023 in the latest version of the marker bundle.
Regards
The text was updated successfully, but these errors were encountered: