From 64a02223ed90b41be090265161bd07d347351a41 Mon Sep 17 00:00:00 2001 From: Jawira Portugal Date: Fri, 12 Jun 2026 11:11:50 +0200 Subject: [PATCH 1/2] fix: Add parent constructor call in EnumReflectionProperty --- phpstan-baseline.neon | 12 ------ src/Reflection/EnumReflectionProperty.php | 42 +------------------ .../Reflection/EnumReflectionPropertyTest.php | 12 ++++++ 3 files changed, 14 insertions(+), 52 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e14ded7e..1bf49ced 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -18,18 +18,6 @@ parameters: count: 1 path: src/ObjectManagerDecorator.php - - - message: '#^Doctrine\\Persistence\\Reflection\\EnumReflectionProperty\:\:__construct\(\) does not call parent constructor from ReflectionProperty\.$#' - identifier: constructor.missingParentCall - count: 1 - path: src/Reflection/EnumReflectionProperty.php - - - - message: '#^Method Doctrine\\Persistence\\Reflection\\EnumReflectionProperty\:\:getDeclaringClass\(\) return type with generic class ReflectionClass does not specify its types\: T$#' - identifier: missingType.generics - count: 1 - path: src/Reflection/EnumReflectionProperty.php - - message: '#^Method Doctrine\\Persistence\\Reflection\\EnumReflectionProperty\:\:toEnum\(\) should return array\\|BackedEnum but returns array\\.$#' identifier: return.type diff --git a/src/Reflection/EnumReflectionProperty.php b/src/Reflection/EnumReflectionProperty.php index 01394270..188366b4 100644 --- a/src/Reflection/EnumReflectionProperty.php +++ b/src/Reflection/EnumReflectionProperty.php @@ -5,9 +5,7 @@ namespace Doctrine\Persistence\Reflection; use BackedEnum; -use ReflectionClass; use ReflectionProperty; -use ReflectionType; use ReturnTypeWillChange; use function array_map; @@ -28,33 +26,12 @@ class EnumReflectionProperty extends ReflectionProperty /** @param class-string $enumType */ public function __construct(ReflectionProperty $originalReflectionProperty, string $enumType) { + parent::__construct($originalReflectionProperty->class, $originalReflectionProperty->name); + $this->originalReflectionProperty = $originalReflectionProperty; $this->enumType = $enumType; } - public function getDeclaringClass(): ReflectionClass - { - return $this->originalReflectionProperty->getDeclaringClass(); - } - - public function getName(): string - { - return $this->originalReflectionProperty->getName(); - } - - public function getType(): ?ReflectionType - { - return $this->originalReflectionProperty->getType(); - } - - /** - * {@inheritDoc} - */ - public function getAttributes(?string $name = null, int $flags = 0): array - { - return $this->originalReflectionProperty->getAttributes($name, $flags); - } - /** * {@inheritDoc} * @@ -133,19 +110,4 @@ private function toEnum($value) return $this->enumType::from($value); } - - public function getModifiers(): int - { - return $this->originalReflectionProperty->getModifiers(); - } - - public function getDocComment(): string|false - { - return $this->originalReflectionProperty->getDocComment(); - } - - public function isPrivate(): bool - { - return $this->originalReflectionProperty->isPrivate(); - } } diff --git a/tests_php81/Reflection/EnumReflectionPropertyTest.php b/tests_php81/Reflection/EnumReflectionPropertyTest.php index 57590a8b..c8e0f760 100644 --- a/tests_php81/Reflection/EnumReflectionPropertyTest.php +++ b/tests_php81/Reflection/EnumReflectionPropertyTest.php @@ -131,6 +131,18 @@ public function testIsPrivate(): void $reflProperty = new EnumReflectionProperty(new ReflectionProperty(TypedEnumClass::class, 'suit'), Suit::class); self::assertFalse($reflProperty->isPrivate()); } + + public function testIsPublic(): void + { + $reflProperty = new EnumReflectionProperty(new ReflectionProperty(TypedEnumClass::class, 'suit'), Suit::class); + self::assertTrue($reflProperty->isPublic()); + } + + public function testHasDefaultValue(): void + { + $reflProperty = new EnumReflectionProperty(new ReflectionProperty(TypedEnumClass::class, 'suit'), Suit::class); + self::assertTrue($reflProperty->hasDefaultValue()); + } } #[Attribute(Attribute::TARGET_PROPERTY)] From 3aaf119a0bdb8ce57b37b59cd485ee47a27fba31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Jun 2026 19:22:09 +0000 Subject: [PATCH 2/2] Bump the doctrine group with 5 updates Bumps the doctrine group with 5 updates: | Package | From | To | | --- | --- | --- | | [doctrine/.github/.github/workflows/coding-standards.yml](https://github.com/doctrine/.github) | `15.0.0` | `15.1.0` | | [doctrine/.github/.github/workflows/continuous-integration.yml](https://github.com/doctrine/.github) | `15.0.0` | `15.1.0` | | [doctrine/.github/.github/workflows/documentation.yml](https://github.com/doctrine/.github) | `15.0.0` | `15.1.0` | | [doctrine/.github/.github/workflows/release-on-milestone-closed.yml](https://github.com/doctrine/.github) | `15.0.0` | `15.1.0` | | [doctrine/.github/.github/workflows/phpstan.yml](https://github.com/doctrine/.github) | `15.0.0` | `15.1.0` | Updates `doctrine/.github/.github/workflows/coding-standards.yml` from 15.0.0 to 15.1.0 - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/15.0.0...15.1.0) Updates `doctrine/.github/.github/workflows/continuous-integration.yml` from 15.0.0 to 15.1.0 - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/15.0.0...15.1.0) Updates `doctrine/.github/.github/workflows/documentation.yml` from 15.0.0 to 15.1.0 - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/15.0.0...15.1.0) Updates `doctrine/.github/.github/workflows/release-on-milestone-closed.yml` from 15.0.0 to 15.1.0 - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/15.0.0...15.1.0) Updates `doctrine/.github/.github/workflows/phpstan.yml` from 15.0.0 to 15.1.0 - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/15.0.0...15.1.0) --- updated-dependencies: - dependency-name: doctrine/.github/.github/workflows/coding-standards.yml dependency-version: 15.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: doctrine - dependency-name: doctrine/.github/.github/workflows/continuous-integration.yml dependency-version: 15.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: doctrine - dependency-name: doctrine/.github/.github/workflows/documentation.yml dependency-version: 15.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: doctrine - dependency-name: doctrine/.github/.github/workflows/release-on-milestone-closed.yml dependency-version: 15.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: doctrine - dependency-name: doctrine/.github/.github/workflows/phpstan.yml dependency-version: 15.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: doctrine ... Signed-off-by: dependabot[bot] --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/continuous-integration.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/release-on-milestone-closed.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index cd8b9bc7..34d41214 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -12,6 +12,6 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@15.0.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@15.1.0" with: composer-root-version: "3.0" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 088a6b69..7dc7e674 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,7 +12,7 @@ on: jobs: phpunit: name: "PHPUnit" - uses: "doctrine/.github/.github/workflows/continuous-integration.yml@15.0.0" + uses: "doctrine/.github/.github/workflows/continuous-integration.yml@15.1.0" with: composer-root-version: "3.0" php-versions: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]' diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 640f06bd..04037de7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,4 +17,4 @@ on: jobs: documentation: name: "Documentation" - uses: "doctrine/.github/.github/workflows/documentation.yml@15.0.0" + uses: "doctrine/.github/.github/workflows/documentation.yml@15.1.0" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 7100986c..786e150b 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -8,7 +8,7 @@ on: jobs: release: name: "Git tag, release & create merge-up PR" - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@15.0.0" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@15.1.0" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 26a71223..1f24ed41 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,6 +12,6 @@ on: jobs: static-analysis: name: "Static Analysis" - uses: "doctrine/.github/.github/workflows/phpstan.yml@15.0.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@15.1.0" with: composer-root-version: "3.0"