setQuiet() public method

Sets whether all output should be suppressed.
public setQuiet ( boolean $quiet )
$quiet boolean Pass `true` to suppress all output and `false` otherwise.
コード例 #1
0
ファイル: IOOutputTest.php プロジェクト: webmozart/console
 public function testGetVerbosityQuiet()
 {
     $input = new Input(new StringInputStream());
     $output = new Output(new BufferedOutputStream());
     $errorOutput = new Output(new BufferedOutputStream());
     $this->io = new IO($input, $output, $errorOutput);
     $this->output = new IOOutput($this->io);
     $this->io->setQuiet(true);
     $this->assertSame(OutputInterface::VERBOSITY_QUIET, $this->output->getVerbosity());
 }
コード例 #2
0
ファイル: IOOutput.php プロジェクト: webmozart/console
 /**
  * {@inheritdoc}
  */
 public function setVerbosity($level)
 {
     switch ($level) {
         case self::VERBOSITY_QUIET:
             $this->io->setQuiet(true);
             break;
         case self::VERBOSITY_NORMAL:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::NORMAL);
             break;
         case self::VERBOSITY_VERBOSE:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::VERBOSE);
             break;
         case self::VERBOSITY_VERY_VERBOSE:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::VERY_VERBOSE);
             break;
         case self::VERBOSITY_DEBUG:
             $this->io->setQuiet(false);
             $this->io->setVerbosity(IO::DEBUG);
             break;
     }
 }