Skip to content

Add completion for debug:twig #43846

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 1, 2021
Merged

Add completion for debug:twig #43846

merged 1 commit into from
Nov 1, 2021

Conversation

StaffNowa
Copy link
Contributor

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

Add completion for debug:twig

@StaffNowa
Copy link
Contributor Author

StaffNowa commented Nov 1, 2021

@fabpot disabled IDE and tried to clean my code.
Fabbot not happy
image

@fabpot
Copy link
Member

fabpot commented Nov 1, 2021

You can ignore fabbot :)

@StaffNowa
Copy link
Contributor Author

You can ignore fabbot :)

OK 🤣

Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

I've added a couple comments, seems like you missed some things while applying some of Fabien's comments :) If this is fixed, it should be ready to go imho

@StaffNowa
Copy link
Contributor Author

@wouterj thanks for code review. I missed that we have two methods for execute() displayGeneralText() and displayGeneralJson()

Comment on lines 603 to 610
$names = [];
$paths = $this->getLoaderPaths();

foreach ($paths as $namespace => $paths) {
$names[] = $namespace;
}

return $names;
Copy link
Member

Choose a reason for hiding this comment

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

This can be replaced with array_keys($this->getLoaderPaths()) (and can be inlined on line 118 directly)


private function getAvailableFormatOptions(): array
{
return ['text', 'json'];
Copy link
Member

Choose a reason for hiding this comment

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

can be inlined as well

@StaffNowa
Copy link
Contributor Author

@wouterj thanks optimized code :)

@fabpot
Copy link
Member

fabpot commented Nov 1, 2021

Thank you @StaffNowa.

@fabpot fabpot merged commit f377018 into symfony:5.4 Nov 1, 2021
@StaffNowa StaffNowa deleted the feature/debug-twig branch November 1, 2021 14:46
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.

4 participants