[PR #29] [CLOSED] Add ReflectionTypedProperty that doesnt trigger unitialized value error. #35

Open
opened 2026-01-24 11:24:54 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/reflection/pull/29
Author: @beberlei
Created: 1/8/2020
Status: Closed

Base: masterHead: ReflectionTypedProperty


📝 Commits (2)

  • a2a8e2a Add ReflectionTypedProperty with getValue that doesnt trigger unitialized value.
  • 0751304 Remove rm composer.lock

📊 Changes

4 files changed (+40 additions, -1 deletions)

View changed files

📝 .travis.yml (+0 -1)
lib/Doctrine/Common/Reflection/ReflectionTypedProperty.php (+17 -0)
📝 phpunit.xml.dist (+1 -0)
��� tests/Doctrine_PHP74/ReflectionTypedPropertyTest.php (+22 -0)

📄 Description

We need to add checks for if an property is initialized before calling getValue on it, otherwise ORM will throw Unitialized value exceptions when hydrating new entities.

To avoid a performance hit for properties that are not typed, we need to avoid checking for typed properties whenever we call ReflectionProperty::getValue() by using a subclass that is only used for properties that are:

  • typed
  • don't have a default value

This PR is one part of a three part fix that will continue in doctrine/reflection and will end in doctrine/orm.

Next steps:

  • Release doctrine/reflection 1.1
  • Update doctrine/persistence 1.2, 1.3 and master to use the new version, and update RuntimeReflectionService to create a ReflectionTypedProperty
  • Update doctrine/orm 2.7 and 2.8 to latest doctrine/persistence and merge the PR with test fixes https://github.com/doctrine/orm/pull/7857

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/reflection/pull/29 **Author:** [@beberlei](https://github.com/beberlei) **Created:** 1/8/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `ReflectionTypedProperty` --- ### 📝 Commits (2) - [`a2a8e2a`](https://github.com/doctrine/reflection/commit/a2a8e2ae2e6e9057f72b1984b8f812ff783ca14b) Add ReflectionTypedProperty with getValue that doesnt trigger unitialized value. - [`0751304`](https://github.com/doctrine/reflection/commit/07513043778ebfb2a0b9f27714d18982c01268b0) Remove rm composer.lock ### 📊 Changes **4 files changed** (+40 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `.travis.yml` (+0 -1) ➕ `lib/Doctrine/Common/Reflection/ReflectionTypedProperty.php` (+17 -0) 📝 `phpunit.xml.dist` (+1 -0) ��� `tests/Doctrine_PHP74/ReflectionTypedPropertyTest.php` (+22 -0) </details> ### 📄 Description We need to add checks for if an property is initialized before calling getValue on it, otherwise ORM will throw `Unitialized value` exceptions when hydrating new entities. To avoid a performance hit for properties that are not typed, we need to avoid checking for typed properties whenever we call `ReflectionProperty::getValue()` by using a subclass that is only used for properties that are: - typed - don't have a default value This PR is one part of a three part fix that will continue in `doctrine/reflection` and will end in `doctrine/orm`. Next steps: - Release `doctrine/reflection` 1.1 - Update `doctrine/persistence` 1.2, 1.3 and master to use the new version, and update `RuntimeReflectionService` to create a `ReflectionTypedProperty` - Update `doctrine/orm` 2.7 and 2.8 to latest `doctrine/persistence` and merge the PR with test fixes https://github.com/doctrine/orm/pull/7857 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-24 11:24:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/reflection#35