8000 [Console] Display console application name even when no version set by polc · Pull Request #17326 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Display console application name even when no version set #17326

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 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Console] Display console application name even when no version set
  • Loading branch information
polc committed Jan 10, 2016
commit 4753a2d0f36e3adaa671d30cf0101f766561ff2b
2 changes: 2 additions & 0 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ public function getLongVersion()
{
if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) {
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
} else if ('UNKNOWN' !== $this->getName()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

else is not required here.

return sprintf('<info>%s</info>', $this->getName());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

More clear would be IMO:

if ('UNKNOWN' !== $this->getName()) {
    if ('UNKNOWN' !== $this->getVersion()) {
        return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
    }

    return sprintf('<info>%s</info>', $this->getName());
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's what I had done at first but I thought I was less clear. Anyway I can change no problems !


return '<info>Console Tool</info>';
Expand Down
0