Command API in OCP - #62942
Open
CarlSchwan wants to merge 5 commits into
Open
Conversation
CarlSchwan
requested review from
Altahrim,
come-nc,
leftybournes and
nfebe
and removed request for
a team
August 5, 2026 14:12
CarlSchwan
force-pushed
the
carl/ocp-console
branch
from
August 5, 2026 14:18
a98214d to
cd74d3c
Compare
The API is inspired by modern command registration in Symfony/Console. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
CarlSchwan
force-pushed
the
carl/ocp-console
branch
from
August 5, 2026 14:35
cd74d3c to
0271d20
Compare
Make sure it is somewhat feature complete with the API used in Base. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Allow to change output depending on the verbosity set by the user. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
CarlSchwan
force-pushed
the
carl/ocp-console
branch
from
August 6, 2026 08:25
01f9170 to
26fa843
Compare
come-nc
reviewed
Aug 6, 2026
Comment on lines
63
to
+65
| $format = $input->getOption('output'); | ||
|
|
||
| if ($format === self::OUTPUT_FORMAT_PLAIN) { | ||
| if ($format === 'plain') { |
Contributor
There was a problem hiding this comment.
This smell as missing const in IInput, and/or maybe a method getOutputFormat or something?
| $userId = $input->getArgument('user'); | ||
| public function __invoke( | ||
| IOutput $output, | ||
| #[Argument(description: 'User to refresh mounts for')] string $user, |
Contributor
There was a problem hiding this comment.
Suggested change
| #[Argument(description: 'User to refresh mounts for')] string $user, | |
| #[Argument(description: 'User to refresh mounts for')] | |
| string $user, |
I would prefer a line break after attribute, is that allowed by our php-cs currently?
Contributor
|
I think I like the idea. |
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.
Summary
Inspired by the new API from symfony/console
This will allow us to remove all our ugly stubs in many apps.
Can be used either on a class:
Or on methods:
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)