fix(Console): support symfony/console 5.4 and up - #2197
Open
garak wants to merge 1 commit into
Open
Conversation
GenerateCommand extends Command again, with configure() and execute(); GenerateInput is a plain DTO, hydrated by GenerateInput::fromInput() and validating --format and --mode itself. bin/openapi calls Application::addCommand() where it exists and add() otherwise, and its ArgvInput subclass leaves hasParameterOption() untyped, as 5.4 declares no parameter type there. DocsAccuracyTest compares only the command's own help; the built-in options below --help differ per console version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The
symfony/consolerequirement of^7.4kept swagger-php off Symfony 6.4 LTS, which is supported until November 2027. The console component is only used by the CLI, and the requirement came from the command layer using the input-mapping attributes that only exist as of 7.4.The CLI surface is unchanged:
openapi -hreports the same arguments and options, and--versionstill sets the OpenAPI version rather than printing the toolversion.
Closes #2180.
Changes
symfony/consoleis accepted from 5.4 (generally, thesymfony/*constraints are now consistent)GenerateCommandis aCommandsubclass again, defining its input inconfigure()and running inexecute().GenerateInputis a plain DTO, hydrated byGenerateInput::fromInput(), which also validates--formatand--mode.bin/openapiregisters the command through whichever ofApplication::addCommand()andApplication::add()the installed console offers, and itsArgvInputsubclass no longer typeshasParameterOption().DocsAccuracyTestcompares the command's own help only; the built-in options below--helpdiffer per console version.