Procházet zdrojové kódy

[Console] Removed useless else

Pascal Borreli před 14 roky
rodič
revize
46d28ce1b1

+ 4 - 4
src/Symfony/Component/Console/Application.php

@@ -129,9 +129,9 @@ class Application
             // @codeCoverageIgnoreStart
             exit($statusCode);
             // @codeCoverageIgnoreEnd
-        } else {
-            return $statusCode;
         }
+
+        return $statusCode;
     }
 
     /**
@@ -315,9 +315,9 @@ class Application
     {
         if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) {
             return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
-        } else {
-            return '<info>Console Tool</info>';
         }
+
+        return '<info>Console Tool</info>';
     }
 
     /**

+ 2 - 2
src/Symfony/Component/Console/Command/Command.php

@@ -159,9 +159,9 @@ class Command
 
         if ($this->code) {
             return call_user_func($this->code, $input, $output);
-        } else {
-            return $this->execute($input, $output);
         }
+
+        return $this->execute($input, $output);
     }
 
     /**

+ 2 - 2
src/Symfony/Component/Console/Helper/DialogHelper.php

@@ -61,9 +61,9 @@ class DialogHelper extends Helper
 
         if (false === $default) {
             return $answer && 'y' == strtolower($answer[0]);
-        } else {
-            return !$answer || 'y' == strtolower($answer[0]);
         }
+
+        return !$answer || 'y' == strtolower($answer[0]);
         // @codeCoverageIgnoreEnd
     }
 

+ 2 - 2
src/Symfony/Component/Console/Input/ArgvInput.php

@@ -275,9 +275,9 @@ class ArgvInput extends Input
                 if (0 === strpos($token, $value)) {
                     if (false !== $pos = strpos($token, '=')) {
                         return substr($token, $pos + 1);
-                    } else {
-                        return array_shift($tokens);
                     }
+
+                    return array_shift($tokens);
                 }
             }
         }

+ 2 - 2
src/Symfony/Component/Console/Output/StreamOutput.php

@@ -97,9 +97,9 @@ class StreamOutput extends Output
         // @codeCoverageIgnoreStart
         if (DIRECTORY_SEPARATOR == '\\') {
             return false !== getenv('ANSICON');
-        } else {
-            return function_exists('posix_isatty') && @posix_isatty($this->stream);
         }
+
+        return function_exists('posix_isatty') && @posix_isatty($this->stream);
         // @codeCoverageIgnoreEnd
     }
 }