Преглед на файлове

[Console] added a missing method (closes #3043)

Fabien Potencier преди 13 години
родител
ревизия
0492290a3b
променени са 2 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. 10 0
      src/Symfony/Component/Console/Command/Command.php
  2. 1 1
      src/Symfony/Component/Console/Command/HelpCommand.php

+ 10 - 0
src/Symfony/Component/Console/Command/Command.php

@@ -67,6 +67,16 @@ class Command
         }
     }
 
+    /**
+     * Ignores validation errors.
+     *
+     * This is mainly useful for the help command.
+     */
+    public function ignoreValidationErrors()
+    {
+        $this->ignoreValidationErrors = true;
+    }
+
     /**
      * Sets the application instance for this command.
      *

+ 1 - 1
src/Symfony/Component/Console/Command/HelpCommand.php

@@ -32,7 +32,7 @@ class HelpCommand extends Command
      */
     protected function configure()
     {
-        $this->ignoreValidationErrors = true;
+        $this->ignoreValidationErrors();
 
         $this
             ->setDefinition(array(