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 changed the type declaration from “?int” to Union Type “int|null” and now I get a lot of “Default null value for not-nullable property is invalid” errors, because of “WebimpressCodingStandard.Classes.NoNullValues.Invalid”.
private int|null $id = null;
This produces “Default null value for not-nullable property is invalid” error and when I automatically fix it, it deletes the part “ = null” and breaks my code. The property is nullable and has as default value null. I don't understand why it says it is not-nullable.
private ?int $id = null;
This instead produces no errors and works fine.
PHP version: 8.2
The text was updated successfully, but these errors were encountered:
I changed the type declaration from “?int” to Union Type “int|null” and now I get a lot of “Default null value for not-nullable property is invalid” errors, because of “WebimpressCodingStandard.Classes.NoNullValues.Invalid”.
private int|null $id = null;
This produces “Default null value for not-nullable property is invalid” error and when I automatically fix it, it deletes the part “ = null” and breaks my code. The property is nullable and has as default value null. I don't understand why it says it is not-nullable.
private ?int $id = null;
This instead produces no errors and works fine.
PHP version: 8.2
The text was updated successfully, but these errors were encountered: