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
Prev Previous commit
Next Next commit
Remove else
  • Loading branch information
polc committed Jan 10, 2016
commit d78fd976ede26f981fc8ba320e2831b802e20a35
3 changes: 2 additions & 1 deletion src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +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()) {
}
if ('UNKNOWN' !== $this->getName()) {
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 !


Expand Down
0