[PR #8945] Document possibly-null member variables #11277

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

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

State: closed
Merged: Yes


Many of the variables in AbstractHydrator are not initialized in the
constructor, and should be documented as possibly null because of that.
Introducing accessors that perform null checks allows to to have to do
these null checks when using the accessors.
Making the member variables private would be a backwards-compatibility
break and could be considered for the next major version.

This makes Psalm's and PHPStan's baselines smaller, and should make
implementing new hydrators easier.

This should help with #8919

**Original Pull Request:** https://github.com/doctrine/orm/pull/8945 **State:** closed **Merged:** Yes --- Many of the variables in `AbstractHydrator` are not initialized in the constructor, and should be documented as possibly null because of that. Introducing accessors that perform null checks allows to to have to do these null checks when using the accessors. Making the member variables private would be a backwards-compatibility break and could be considered for the next major version. This makes Psalm's and PHPStan's baselines smaller, and should make implementing new hydrators easier. This should help with #8919
admin added the pull-request label 2026-01-22 16:10:14 +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#11277