Skip to content

Conversation

@vrana
Copy link
Contributor

@vrana vrana commented Sep 6, 2025

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

I wanted to add an option with one of allowed values. To do that, I needed to check the argument validity, format help and set suggested values. This PR encapsulates it in a function.

@vrana vrana requested a review from chalasr as a code owner September 6, 2025 09:09
@carsonbot carsonbot added this to the 7.4 milestone Sep 6, 2025
@vrana vrana force-pushed the addOptionWithValue branch 3 times, most recently from f036b81 to 373bb7d Compare September 6, 2025 10:33
@vrana vrana force-pushed the addOptionWithValue branch from 1da295d to 2491e57 Compare September 6, 2025 14:06
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.

This feature seems redundant with the possibility of using a BackedEnum type with invokable commands. #60586

Also, you cannot use a new features of a component directly in other components without changing the required version in all their composer.json files. But we avoid adding constraints in minor versions as much as possible. This feature does not justify it here. Changing this could only be done in 8.0. But let's discuss the feature itself before looking at how it is used in Symfony commands.

@vrana vrana force-pushed the addOptionWithValue branch 2 times, most recently from 55624d7 to b81a3a0 Compare September 7, 2025 04:48
@vrana
Copy link
Contributor Author

vrana commented Sep 7, 2025

This is much simpler to use. I've dropped the commit using it in the existing code. Here it is if someone wants to take a look: 55624d7.

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