Skip to content

[Config] Add support for enums in ReflectionClassResource #61079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 7.4
Choose a base branch
from

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Jul 9, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues
License MIT

I'm using ReflectionClassResource in a project to track changes of files. I noticed that attributes on enum cases were not tracked properly. The cases were visible, because the enum cases are available as class constants.

But the attributes were missing.

This solves the problem.

Not sure if we should see this as a bug or feature. I think it's a bug.

@carsonbot carsonbot added this to the 7.4 milestone Jul 9, 2025
@ruudk ruudk force-pushed the ReflectionClassResource-enum branch from d42a3e3 to 230a888 Compare July 9, 2025 11:55
@ruudk ruudk force-pushed the ReflectionClassResource-enum branch from 230a888 to b3f6c68 Compare July 9, 2025 12:03
@OskarStark OskarStark changed the title [Config] Add support for enums in ReflectionClassResource [Config] Add support for enums in ReflectionClassResource Jul 9, 2025
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious about your use case for enums with configuration.

@ruudk
Copy link
Contributor Author

ruudk commented Jul 9, 2025

I am curious about your use case for enums with configuration.

I have a compiler that creates PHP code based on some classes and enums I declare in my application. I use the resources to quickly check if there are changes and if I should recompile.

To be specific: it's creating Webonyx GraphQL type files, which are annoying to create by hand (arrays etc). Therefore we have our own abstraction with attributes.

@ruudk
Copy link
Contributor Author

ruudk commented Jul 9, 2025

@GromNaN that is a valid use case for these classes, right?

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

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy