Skip to content

fix: Add parent constructor call in EnumReflectionProperty - #514

Merged
greg0ire merged 1 commit into
doctrine:3.4.xfrom
jawira:call-reflection-parent
Jun 13, 2026
Merged

greg0ire merged 1 commit into
doctrine:3.4.xfrom
jawira:call-reflection-parent

Conversation

@jawira

@jawira jawira commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Hello, this PR is a backport of #422 to the 3.4.x branch.
The original fix was merged into 4.0.x, this PR applies the same solution to the 3.4.x branch.

The issue this PR solves is explained in: #423

Comment thread src/Reflection/EnumReflectionProperty.php Outdated

@greg0ire greg0ire left a comment

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.

Why did you not also backport the new tests?

@jawira
jawira force-pushed the call-reflection-parent branch from 6420737 to e7d361a Compare June 13, 2026 09:14
@jawira

jawira commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Why did you not also backport the new tests?

It was an oversight, I have just commit the tests.

@jawira
jawira force-pushed the call-reflection-parent branch from e7d361a to 33fee23 Compare June 13, 2026 13:15
@jawira
jawira force-pushed the call-reflection-parent branch from 33fee23 to 64a0222 Compare June 13, 2026 13:18
@greg0ire greg0ire added the Bug Something isn't working label Jun 13, 2026
@greg0ire greg0ire added this to the 3.4.5 milestone Jun 13, 2026
@greg0ire
greg0ire merged commit 5710ea8 into doctrine:3.4.x Jun 13, 2026
15 checks passed
@greg0ire

Copy link
Copy Markdown
Member

Thanks @jawira !

parent::__construct($originalReflectionProperty->class, $originalReflectionProperty->name);

$this->originalReflectionProperty = $originalReflectionProperty;
$this->enumType = $enumType;

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.

@jawira shouldn't these 2 lines have vanished? They are not present on 4.2.x

@jawira jawira Jun 14, 2026 •

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.

@greg0ire Those two lines are present in the 4.2.x branch, but they are implemented using constructor property promotion.

image

I can't use the same syntax in the 3.4.x branch because constructor property promotion was introduced in PHP 8.0, while the minimum supported PHP version for 3.4.x is PHP 7.2. The syntax is different, but the semantics are the same.

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 right! Didn't spot that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants