Skip to content

Fix docs on final entities#12176

Merged
SenseException merged 1 commit intodoctrine:3.5.xfrom
garak:fix-final-in-docs
Sep 25, 2025
Merged

Fix docs on final entities#12176
SenseException merged 1 commit intodoctrine:3.5.xfrom
garak:fix-final-in-docs

Conversation

@garak
Copy link
Copy Markdown
Contributor

@garak garak commented Sep 23, 2025

Fix #12156

I'm not sure about the wording. I'm open to suggestions.

- An entity class must not be final nor read-only but
it may contain final methods or read-only properties.
- An entity class can be final or read-only when
you use :ref:`native lazy object<reference-native-lazy-objects>`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
you use :ref:`native lazy object<reference-native-lazy-objects>`.
you use :ref:`native lazy objects<reference-native-lazy-objects>`.

it may contain final methods or read-only properties.
- An entity class can be final or read-only when
you use :ref:`native lazy object<reference-native-lazy-objects>`.
It may always contain final methods or read-only properties.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to say "also" instead of "always"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to say "also" instead of "always"?

Nope. The properties can be final/ro in any case, so "always" is correct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok… feels a bit weird that you don't use the same wording for the entity and its methods. Also, it's unclear what cases you are thinking about when you say "in any case"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I get it, it's when using native lazy objects or not 💡

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I think I would reverse it: An entity class may contain final methods or read-only properties, and can be final or read-only as soon as you use…

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It may always contain final methods or read-only properties.
It may contain final methods or read-only properties too.

it may contain final methods or read-only properties.
- An entity class can be final or read-only when
you use :ref:`native lazy object<reference-native-lazy-objects>`.
It may always contain final methods or read-only properties.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It may always contain final methods or read-only properties.
It may contain final methods or read-only properties too.

@SenseException SenseException merged commit 8ad560c into doctrine:3.5.x Sep 25, 2025
1 check passed
@garak garak deleted the fix-final-in-docs branch September 26, 2025 08:44
derrabus added a commit to derrabus/orm that referenced this pull request Oct 7, 2025
* 3.5.x:
  Add a CI job that fails on deprecations (doctrine#12188)
  use the empty string instead of null as an array offset (doctrine#12181)
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
  Fix docs on final entities (doctrine#12176)
  Remove Database and Model First chapters that said little of value.
  Switch to IgnoreDeprecations
  docs: consistent PostgreSQL's name case
  docs: generation strategies differences between DBAL 3 and 4
  Check extra condition to decide if a test was skipped
  Use PHPUnit 11 when possible
  Migrate away from annotations in tests
  Migrate away from assertStringNotMatchesFormat()
  Migrate to willReturn()
  Migrate away from getMockForAbstractClass()
  Fix `IN`/`NOT IN` expression handling and support enums when matching on to-many-collections
derrabus added a commit to derrabus/orm that referenced this pull request Oct 7, 2025
* 3.6.x:
  Add a CI job that fails on deprecations (doctrine#12188)
  use the empty string instead of null as an array offset (doctrine#12181)
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
  Fix docs on final entities (doctrine#12176)
  Remove Database and Model First chapters that said little of value.
  Switch to IgnoreDeprecations
  Fix php doc for getPropertyAccessors method (doctrine#12159)
  docs: consistent PostgreSQL's name case
  docs: generation strategies differences between DBAL 3 and 4
  Check extra condition to decide if a test was skipped
  Use PHPUnit 11 when possible
  Migrate away from annotations in tests
  Migrate away from assertStringNotMatchesFormat()
  Migrate to willReturn()
  Migrate away from getMockForAbstractClass()
  Fix `IN`/`NOT IN` expression handling and support enums when matching on to-many-collections
derrabus added a commit to derrabus/orm that referenced this pull request Oct 8, 2025
* 3.6.x:
  Fix missing import
  Remove calls to getMockForAbstractClass() (doctrine#12003)
  Add a CI job that fails on deprecations (doctrine#12188)
  use the empty string instead of null as an array offset (doctrine#12181)
  Upgrade to doctrine/coding-standard 14
  Bump doctrine/.github from 7.3.0 to 8.0.0
  do not call setAccessible() on PHP >= 8.1 (doctrine#12182)
  Fix docs on final entities (doctrine#12176)
  Remove Database and Model First chapters that said little of value.
  Switch to IgnoreDeprecations
  Fix php doc for getPropertyAccessors method (doctrine#12159)
  docs: consistent PostgreSQL's name case
  docs: generation strategies differences between DBAL 3 and 4
  Check extra condition to decide if a test was skipped
  Use PHPUnit 11 when possible
  Migrate away from annotations in tests
  Migrate away from assertStringNotMatchesFormat()
  Migrate to willReturn()
  Migrate away from getMockForAbstractClass()
  Fix `IN`/`NOT IN` expression handling and support enums when matching on to-many-collections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs about final entities

3 participants