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
More clear
  • Loading branch information
polc committed Jan 14, 2016
commit f4c64dd09858aaea2a19f96785028d91d644a7e2
7 changes: 4 additions & 3 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@ public function setVersion($version)
*/
public function getLongVersion()
{
if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) {
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
}
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

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