mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #9340] Use the readonly annotation #11541
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/9340
State: closed
Merged: Yes
Several public properties are documented as
READ-ONLY: <some explanation>. However, in the meantime, PHP has implemented realreadonlyproperties and Psalm supports the docblock annotation@readonlyto emulate its sematics.https://psalm.dev/docs/annotating_code/supported_annotations/#psalm-readonly-and-readonly
I propose to switch to that annotation to allow Psalm to detect unintended access to those properties.
Note: I have skipped the
ClassMetadataInfoclass because most of the properties flagged asREAD-ONLYthere are actually not used accoding to PHP 8.1's semantics.