Skip to content

[FrameworkBundle] Add completion for workflow:dump #43848

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

Merged
merged 1 commit into from
Nov 3, 2021
Merged

[FrameworkBundle] Add completion for workflow:dump #43848

merged 1 commit into from
Nov 3, 2021

Conversation

StaffNowa
Copy link
Contributor

@StaffNowa StaffNowa commented Oct 30, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets #43594
License MIT
Doc PR -

Add completion for workflow:dump
We do not have tests here at all


private function getAvailableNameArguments(): array
{
$names = [];
Copy link
Contributor

@noniagriconomie noniagriconomie Nov 2, 2021

Choose a reason for hiding this comment

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

why not inject them from the FrameworkExtension like inside the workflow.registry?

doing this, we can remove the $container::has() from this class inside the execute() method
we check if the passed name is inside the array of workflows (workflow+statemachine) injected

Copy link
Contributor Author

@StaffNowa StaffNowa Nov 2, 2021

Choose a reason for hiding this comment

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

I see container get definition but cannot inject into command 😢 do I need get configs or whole registry class 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

@StaffNowa StaffNowa Nov 2, 2021

Choose a reason for hiding this comment

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

I think just do not know how. If good understand I need inject configuration to load this one

$config['workflows'] 

Copy link
Contributor

Choose a reason for hiding this comment

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

I think just do not know how. If good understand I need inject configuration to load this one

pass this (or a new array computed from this list) inside the command construct, then in the execute and the complete methods you can get those and handle the logic

Copy link
Contributor

Choose a reason for hiding this comment

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

@StaffNowa as discussed on slack, I've sent you an example you can pick then continue working on this :)


private function getAvailableDumpFormatOptions(): array
{
return ['puml', 'mermaid', 'dot'];
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe create private consts? and refactor the switch/case above

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Please add a test.

@carsonbot carsonbot changed the title Add completion for workflow:dump [FrameworkBundle] Add completion for workflow:dump Nov 2, 2021
Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

As we are not relying on the container anymore, it means that we could move the command to the component now instead of keeping it in the framework bundle. Might be great in a follow-up PR for 5.4.

@fabpot
Copy link
Member

fabpot commented Nov 3, 2021

Thank you @StaffNowa.

@fabpot fabpot merged commit 6d4e4bd into symfony:5.4 Nov 3, 2021
This was referenced Nov 5, 2021
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.

6 participants