Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] [DX] Fix command description/help display #26439

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

Closed
wants to merge 1 commit into from

Conversation

noniagriconomie
Copy link
Contributor

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #26376
License MIT
Doc PR none

Hi,

Here is a fix for the issue #26376

I only patch the text descriptor, should I do it for others?
(I do not think so as the main and default one is text)

Thanks

@noniagriconomie noniagriconomie changed the title [Console] Fix command description display [Console] [DX] Fix command description display Mar 7, 2018
@noniagriconomie noniagriconomie changed the title [Console] [DX] Fix command description display [Console] [DX] Fix command description/help display Mar 7, 2018
$this->writeText(' '.$description);
$this->writeText("\n\n");
}

Copy link
Contributor Author

@noniagriconomie noniagriconomie Mar 7, 2018

Choose a reason for hiding this comment

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

should as well the $command->getProcessedHelp() return only the $command->getHelp() and not sometimes the $command->getDescription()? so description will be only on top and not at the bottom?
line https://github.com/symfony/symfony/pull/26439/files#diff-f21e3938d69281cd0815f081627d9c34R164

Copy link
Member

Choose a reason for hiding this comment

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

I think it should yes, it's weird that getProcessedHelp() can return the description., but I'm not sure it's fine to change it now. Instead, could we display the Help section (calling getProcessedHelp()) only if getHelp() is not null? or only if getProcessedHelp() !== getDescription()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chalasr ok, I will change the called method here

@chalasr chalasr self-requested a review March 7, 2018 10:45
@chalasr chalasr added this to the 2.7 milestone Mar 7, 2018
@chalasr
Copy link
Member

chalasr commented Mar 7, 2018

@noniagriconomie For other descriptors, I also think they don't need to be updated. In fact, the TextDescriptor seems to be the only one that does not contain the description.

By the way, I must say that you're working on a part which is quite hard to update and not very "first-time-contribution friendly" (not contribution friendly at all in fact), and you just do it perfectly for now!
Congratz, welcome and thank you for contributing to Symfony :)

@noniagriconomie
Copy link
Contributor Author

noniagriconomie commented Mar 7, 2018

@chalasr PR code updated accordingly
Ok for others command descriptors :)

@@ -154,7 +161,8 @@ protected function describeCommand(Command $command, array $options = array())
$this->writeText("\n");
}

if ($help = $command->getProcessedHelp()) {
$help = $command->getProcessedHelp();
if ($help !== $command->getDescription()) {
Copy link
Member

Choose a reason for hiding this comment

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

should be $help && $help !== $description

Copy link
Contributor Author

@noniagriconomie noniagriconomie Mar 8, 2018

Choose a reason for hiding this comment

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

👍 change is done @chalasr

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

@noniagriconomie I love DX issues, so thanks a lot for contributing this one. And congrats on your first Symfony contribution!

@noniagriconomie
Copy link
Contributor Author

@javiereguiluz hope this help a lot of sf devs :)
regards

@fabpot
Copy link
Member

fabpot commented Mar 10, 2018

@noniagriconomie Thanks for the pull request. I don't think this qualifies as a bug. So, I'm going to merge it into master into 2.7.

@fabpot
Copy link
Member

fabpot commented Mar 10, 2018

Thank you @noniagriconomie.

@fabpot fabpot closed this in 330cf8d Mar 10, 2018
@ogizanagi ogizanagi mentioned this pull request Mar 11, 2018
chalasr added a commit that referenced this pull request Mar 12, 2018
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Console] Fix tests

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Fix Console tests after #26439 merge.

Commits
-------

c429fa0 [Console] Fix tests
@fabpot fabpot mentioned this pull request May 7, 2018
@noniagriconomie noniagriconomie deleted the ticket_26376 branch June 5, 2018 07:26
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.

5 participants