Browse Source

Rename diag to diagnose, fix feedback

Jordi Boggiano 12 năm trước cách đây
mục cha
commit
605cd3ddc3

+ 3 - 3
doc/03-cli.md

@@ -348,13 +348,13 @@ performance.
   autoloader. This is recommended especially for production, but can take
   a bit of time to run so it is currently not done by default.
 
-## diag
+## diagnose
 
 If you think you found a bug, or something is behaving strangely, you might
-want to run the `diag` command to perform automated checks for many common
+want to run the `diagnose` command to perform automated checks for many common
 problems.
 
-    $ php composer.phar diag
+    $ php composer.phar diagnose
 
 ## help
 

+ 5 - 5
src/Composer/Command/DiagCommand.php → src/Composer/Command/DiagnoseCommand.php

@@ -24,7 +24,7 @@ use Symfony\Component\Console\Output\OutputInterface;
 /**
  * @author Jordi Boggiano <j.boggiano@seld.be>
  */
-class DiagCommand extends Command
+class DiagnoseCommand extends Command
 {
     protected $rfs;
     protected $failures = 0;
@@ -32,10 +32,10 @@ class DiagCommand extends Command
     protected function configure()
     {
         $this
-            ->setName('diag')
+            ->setName('diagnose')
             ->setDescription('Diagnoses the system to identify common errors.')
             ->setHelp(<<<EOT
-The <info>diag</info> command checks common errors to help debugging problems.
+The <info>diagnose</info> command checks common errors to help debugging problems.
 
 EOT
             )
@@ -162,9 +162,9 @@ EOT
 
         if (Composer::VERSION !== $latest && Composer::VERSION !== '@package_version@') {
             return '<warning>Your are not running the latest version</warning>';
-        } else {
-            return true;
         }
+
+        return true;
     }
 
     private function outputResult(OutputInterface $output, $result)

+ 1 - 1
src/Composer/Console/Application.php

@@ -199,7 +199,7 @@ class Application extends BaseApplication
         $commands[] = new Command\DumpAutoloadCommand();
         $commands[] = new Command\StatusCommand();
         $commands[] = new Command\ArchiveCommand();
-        $commands[] = new Command\DiagCommand();
+        $commands[] = new Command\DiagnoseCommand();
 
         if ('phar:' === substr(__FILE__, 0, 5)) {
             $commands[] = new Command\SelfUpdateCommand();