From 4753a2d0f36e3adaa671d30cf0101f766561ff2b Mon Sep 17 00:00:00 2001 From: Paul LE CORRE Date: Sun, 10 Jan 2016 09:05:40 +0100 Subject: [PATCH 1/3] [Console] Display console application name even when no version set --- src/Symfony/Component/Console/Application.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 6140d3af6e907..d92ab4c86229a 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -324,6 +324,8 @@ public function getLongVersion() { if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { return sprintf('%s version %s', $this->getName(), $this->getVersion()); + } else if ('UNKNOWN' !== $this->getName()) { + return sprintf('%s', $this->getName()); } return 'Console Tool'; From d78fd976ede26f981fc8ba320e2831b802e20a35 Mon Sep 17 00:00:00 2001 From: Paul LE CORRE Date: Sun, 10 Jan 2016 22:13:10 +0800 Subject: [PATCH 2/3] Remove else --- src/Symfony/Component/Console/Application.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index d92ab4c86229a..b60776c765309 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -324,7 +324,8 @@ public function getLongVersion() { if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { return sprintf('%s version %s', $this->getName(), $this->getVersion()); - } else if ('UNKNOWN' !== $this->getName()) { + } + if ('UNKNOWN' !== $this->getName()) { return sprintf('%s', $this->getName()); } From f4c64dd09858aaea2a19f96785028d91d644a7e2 Mon Sep 17 00:00:00 2001 From: Paul LE CORRE Date: Thu, 14 Jan 2016 08:59:03 +0800 Subject: [PATCH 3/3] More clear --- src/Symfony/Component/Console/Application.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index b60776c765309..78051c37ecf83 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -322,10 +322,11 @@ public function setVersion($version) */ public function getLongVersion() { - if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { - return sprintf('%s version %s', $this->getName(), $this->getVersion()); - } if ('UNKNOWN' !== $this->getName()) { + if ('UNKNOWN' !== $this->getVersion()) { + return sprintf('%s version %s', $this->getName(), $this->getVersion()); + } + return sprintf('%s', $this->getName()); }