Skip to content

Allow class inheritance determination for enums#16

Merged
Crell merged 2 commits intoCrell:masterfrom
agustingomes:enum-implementing-interface
Mar 6, 2026
Merged

Allow class inheritance determination for enums#16
Crell merged 2 commits intoCrell:masterfrom
agustingomes:enum-implementing-interface

Conversation

@agustingomes
Copy link
Copy Markdown
Contributor

@agustingomes agustingomes commented Mar 1, 2026

Description

Read enum implemented interfaces and its attributes

Motivation and context

In the scope of a downstream project issue, It was noticed that in cases where an enum implemented an interface, the interface attributes could not be read.

This change allows ReflectionEnum to retrieve such information if it exists.

How has this been tested?

Unit test case has been added to existing test

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • I have added tests to cover my changes.
  • If my change requires a change to the documentation, I have updated it accordingly.

Comment thread README.md Outdated
Comment thread README.md Outdated
@agustingomes agustingomes force-pushed the enum-implementing-interface branch from e949de1 to 93f1875 Compare March 2, 2026 16:11
@agustingomes
Copy link
Copy Markdown
Contributor Author

@Crell Thank you for the review and the suggestions. I applied them.

Comment thread README.md Outdated
Comment thread src/AttributeParser.php Outdated
### Motivation

In the scope of [a downstream project issue](Crell/Serde#10), It was noticed that in cases where an enum implemented an interface, the interface attributes could not be read.

This change allows `ReflectionEnum` to retrieve such information if it exists
@agustingomes agustingomes force-pushed the enum-implementing-interface branch from 93f1875 to 829d9cc Compare March 2, 2026 18:15
@agustingomes agustingomes requested a review from Crell March 2, 2026 18:16
Comment thread README.md Outdated
@Crell Crell merged commit a118b55 into Crell:master Mar 6, 2026
7 checks passed
@Crell
Copy link
Copy Markdown
Owner

Crell commented Mar 6, 2026

All set, thanks!

@agustingomes agustingomes deleted the enum-implementing-interface branch March 7, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants