Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NullOutput.php

class NullOutput

NullOutput suppresses all output.

$output = new NullOutput();

@author Fabien Potencier <fabien@symfony.com> @author Tobias Schultze <http://tobion.de&gt;

Hierarchy

  • class \Symfony\Component\Console\Output\NullOutput implements \Symfony\Component\Console\Output\OutputInterface

Expanded class hierarchy of NullOutput

File

vendor/symfony/console/Output/NullOutput.php, line 25

Namespace

Symfony\Component\Console\Output
View source
class NullOutput implements OutputInterface {
    private NullOutputFormatter $formatter;
    public function setFormatter(OutputFormatterInterface $formatter) : void {
        // do nothing
    }
    public function getFormatter() : OutputFormatterInterface {
        // to comply with the interface we must return a OutputFormatterInterface
        return $this->formatter ??= new NullOutputFormatter();
    }
    public function setDecorated(bool $decorated) : void {
        // do nothing
    }
    public function isDecorated() : bool {
        return false;
    }
    public function setVerbosity(int $level) : void {
        // do nothing
    }
    public function getVerbosity() : int {
        return self::VERBOSITY_SILENT;
    }
    public function isSilent() : bool {
        return true;
    }
    public function isQuiet() : bool {
        return false;
    }
    public function isVerbose() : bool {
        return false;
    }
    public function isVeryVerbose() : bool {
        return false;
    }
    public function isDebug() : bool {
        return false;
    }
    public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) : void {
        // do nothing
    }
    public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) : void {
        // do nothing
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
NullOutput::$formatter private property
NullOutput::getFormatter public function Returns current output formatter instance. Overrides OutputInterface::getFormatter
NullOutput::getVerbosity public function Gets the current verbosity of the output. Overrides OutputInterface::getVerbosity
NullOutput::isDebug public function Returns whether verbosity is debug (-vvv). Overrides OutputInterface::isDebug
NullOutput::isDecorated public function Gets the decorated flag. Overrides OutputInterface::isDecorated
NullOutput::isQuiet public function Returns whether verbosity is quiet (-q). Overrides OutputInterface::isQuiet
NullOutput::isSilent public function
NullOutput::isVerbose public function Returns whether verbosity is verbose (-v). Overrides OutputInterface::isVerbose
NullOutput::isVeryVerbose public function Returns whether verbosity is very verbose (-vv). Overrides OutputInterface::isVeryVerbose
NullOutput::setDecorated public function Sets the decorated flag. Overrides OutputInterface::setDecorated
NullOutput::setFormatter public function Overrides OutputInterface::setFormatter
NullOutput::setVerbosity public function Sets the verbosity of the output. Overrides OutputInterface::setVerbosity
NullOutput::write public function Writes a message to the output. Overrides OutputInterface::write
NullOutput::writeln public function Writes a message to the output and adds a newline at the end. Overrides OutputInterface::writeln
OutputInterface::OUTPUT_NORMAL public constant
OutputInterface::OUTPUT_PLAIN public constant
OutputInterface::OUTPUT_RAW public constant
OutputInterface::VERBOSITY_DEBUG public constant
OutputInterface::VERBOSITY_NORMAL public constant
OutputInterface::VERBOSITY_QUIET public constant
OutputInterface::VERBOSITY_SILENT public constant
OutputInterface::VERBOSITY_VERBOSE public constant
OutputInterface::VERBOSITY_VERY_VERBOSE public constant
RSS feed
Powered by Drupal