fix: symfony/console $suggestedValues compatibility - #112
Conversation
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Joas Schilling <coding@schilljs.com>
|
Hey @nickvergessen, if a compatibility shim is possible, I think doing both 1 & 2 is best. That would be a nice way to conclude this 13 year project without forcing Nextcloud to have a breaking API change. I regard API stability very highly, and have strived for it in this repo despite being technically pre-1.0 ...maybe the 1.0 should have been years ago! If you can verify a patch that works for you, and make any changes needed for you to stand behind it (meets your personal standards, etc), I'm happy scrutinise, review and tie the ribbon on a release. It's really neat to see Symfony finally includes this functionality. As I've become more and more distant from the PHP world over the last 10 years, it's somewhat of a relief to see in many ways. |
…console way Signed-off-by: Joas Schilling <coding@schilljs.com>
Then let me add the deprecation note as well, so people see it when updating and start switching to the symfony/console way, as that works already in all supported symfony versions.
I did that and as said, I patched a Nextcloud with it and it's working great.
That would be much appreciated. |
Assisted-by: ClaudeCode:claude-opus-5
Symfony added native support for autocomplete by now (in 5.4?): https://symfony.com/doc/current/console.html#console-completion-setup
The problem is that the mechanism works different and in order to be compatible with both mechanisms one has to implement both completions.
I currently see basically 2 options:
For anyone that is maintaining a single application, option 1 might even be the best, as it removes one more item in the maintenance chain.
For something that is a framework to a bigger ecosystem ( 👋 Hello from Nextcloud if you remember) option 2 would however be preferred as it would not break existing setups for administrators and neither breaks compatibility with old apps, while still allowing developers to be quite close to symfony/console when specifying/implementing commands (and not seeing a "suggestedValues" functionality on commands that doesn't do anything).
So I asked Claude with Opus5 to create a solution and it looks rather simple. A quick test against the nextcloud/server code base (using a branch that has the reference of CompletionAwareInterface removed nextcloud/server#63792 ) also showed that it's actually working.
To further assist with the transition
CompletionAwareInterfacecould even be deprecated, but I didn't want to overcomplicate the starting point here.