[PR #9791] Deprecate calling setters without arguments #11885

Open
opened 2026-01-22 16:12:12 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/9791

State: closed
Merged: Yes


Calling a setter without anything to set does not really make sense semantically. However, declaring null as the default value for a parameter used to be a common workaround to get a nullable typed parameter. This workaround is obsolete since PHP 7.1 introduced actual nullable types.

This is why I'd like to get rid of those default values on setters.

**Original Pull Request:** https://github.com/doctrine/orm/pull/9791 **State:** closed **Merged:** Yes --- Calling a setter without anything to set does not really make sense semantically. However, declaring `null` as the default value for a parameter used to be a common workaround to get a nullable typed parameter. This workaround is obsolete since PHP 7.1 introduced actual nullable types. This is why I'd like to get rid of those default values on setters.
admin added the pull-request label 2026-01-22 16:12:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11885