Sfoglia il codice sorgente

Merge pull request #6921 from carusogabriel/add-no_useless_else-phpcs

Add no_useless_else in phpcs
Jordi Boggiano 7 anni fa
parent
commit
6d4a8574da
2 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 1 0
      .php_cs
  2. 6 6
      src/Composer/Util/Perforce.php

+ 1 - 0
.php_cs

@@ -39,6 +39,7 @@ return PhpCsFixer\Config::create()
         'no_leading_namespace_whitespace' => true,
         'no_trailing_comma_in_singleline_array' => true,
         'no_unused_imports' => true,
+        'no_useless_else' => true,
         'no_whitespace_in_blank_line' => true,
         'object_operator_without_whitespace' => true,
         'phpdoc_align' => true,

+ 6 - 6
src/Composer/Util/Perforce.php

@@ -243,13 +243,13 @@ class Perforce
             }
 
             return null;
-        } else {
-            $command = 'echo $' . $name;
-            $this->executeCommand($command);
-            $result = trim($this->commandResult);
-
-            return $result;
         }
+
+        $command = 'echo $' . $name;
+        $this->executeCommand($command);
+        $result = trim($this->commandResult);
+
+        return $result;
     }
 
     public function queryP4Password()