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

Breadcrumb

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

class NullOutputFormatter

@author Tien Xuan Vo <tien.xuan.vo@gmail.com>

Hierarchy

  • class \Symfony\Component\Console\Formatter\NullOutputFormatter implements \Symfony\Component\Console\Formatter\OutputFormatterInterface

Expanded class hierarchy of NullOutputFormatter

1 file declares its use of NullOutputFormatter
NullOutput.php in vendor/symfony/console/Output/NullOutput.php

File

vendor/symfony/console/Formatter/NullOutputFormatter.php, line 17

Namespace

Symfony\Component\Console\Formatter
View source
final class NullOutputFormatter implements OutputFormatterInterface {
    private NullOutputFormatterStyle $style;
    public function format(?string $message) : ?string {
        return null;
    }
    public function getStyle(string $name) : OutputFormatterStyleInterface {
        // to comply with the interface we must return a OutputFormatterStyleInterface
        return $this->style ??= new NullOutputFormatterStyle();
    }
    public function hasStyle(string $name) : bool {
        return false;
    }
    public function isDecorated() : bool {
        return false;
    }
    public function setDecorated(bool $decorated) : void {
        // do nothing
    }
    public function setStyle(string $name, OutputFormatterStyleInterface $style) : void {
        // do nothing
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
NullOutputFormatter::$style private property
NullOutputFormatter::format public function Formats a message according to the given styles. Overrides OutputFormatterInterface::format
NullOutputFormatter::getStyle public function Gets style options from style with specified name. Overrides OutputFormatterInterface::getStyle
NullOutputFormatter::hasStyle public function Checks if output formatter has style with specified name. Overrides OutputFormatterInterface::hasStyle
NullOutputFormatter::isDecorated public function Whether the output will decorate messages. Overrides OutputFormatterInterface::isDecorated
NullOutputFormatter::setDecorated public function Sets the decorated flag. Overrides OutputFormatterInterface::setDecorated
NullOutputFormatter::setStyle public function Sets a new style. Overrides OutputFormatterInterface::setStyle

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal