mirror of
https://github.com/doctrine/reflection.git
synced 2026-03-24 08:42:07 +01:00
[PR #29] [CLOSED] Add ReflectionTypedProperty that doesnt trigger unitialized value error. #35
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?
📋 Pull Request Information
Original PR: https://github.com/doctrine/reflection/pull/29
Author: @beberlei
Created: 1/8/2020
Status: ❌ Closed
Base:
master← Head:ReflectionTypedProperty📝 Commits (2)
a2a8e2aAdd ReflectionTypedProperty with getValue that doesnt trigger unitialized value.0751304Remove 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 valueexceptions 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:This PR is one part of a three part fix that will continue in
doctrine/reflectionand will end indoctrine/orm.Next steps:
doctrine/reflection1.1doctrine/persistence1.2, 1.3 and master to use the new version, and updateRuntimeReflectionServiceto create aReflectionTypedPropertydoctrine/orm2.7 and 2.8 to latestdoctrine/persistenceand 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.