mirror of
https://github.com/doctrine/reflection.git
synced 2026-03-24 08:42:07 +01:00
[PR #24] [MERGED] Add reflection typed no default property class #28
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/24
Author: @sspat
Created: 12/2/2019
Status: ✅ Merged
Merged: 1/8/2020
Merged by: @beberlei
Base:
master← Head:add_reflection_typed_no_default_property_class📝 Commits (7)
7070705Added reflection class for handling typed properties without default value #230ac0da5Updated phpunit and travis configs to work with tests containing code in php 7.4 syntax #236efdc3fAdded php 7.4 specific tests directory to composer autoloading config #23bbf9810Changed test assertion method #237fba840Changed dynamic property name access syntax #238299ca4Changed the property access syntax again #239acbb8cReplaced isset with ReflectionProperty::isInitialized #23📊 Changes
4 files changed (+58 additions, -2 deletions)
View changed files
📝
composer.json(+2 -1)➕
lib/Doctrine/Common/Reflection/TypedNoDefaultReflectionProperty.php(+23 -0)📝
phpunit.xml.dist(+2 -1)➕
tests/Doctrine/Tests_PHP74/Common/Reflection/TypedNoDefaultReflectionPropertyTest.php(+31 -0)📄 Description
Implementation for issue https://github.com/doctrine/reflection/issues/23
See discussion in https://github.com/doctrine/orm/pull/7857
As suggested by @beberlei, the
\Doctrine\Common\Reflection\TypedNoDefaultReflectionPropertyclass was introduced.It will be returned in
doctrine/persistencepackage class RuntimeReflectionService::getAccessibleProperty if the property is typed and has no default value. Something like this:Also updated phpunit config as suggested in the discussion in the same issue https://github.com/doctrine/reflection/issues/23.
This allows skipping tests containing php 7.4 specific syntax on builds with lesser php versions.
Also updated
travis-ci.ymlLint job to ignore such tests by phpstan analysis, if the php version is less than 7.4🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.