CoreFiles by mySites.guru
NullOutputFormatter.php51 lines, 1,158 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
78b1536da846ce2da1c43c3c780d343b
sha1
dc496c1501b89e7807980bde5fdb4d84fec1c3e4
sha256
2f2a814bf1ff6714c29451a5344d93df0d45c72d2e4d37826e1e94c3e2297c4a
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Formatter;

/**
 * @author Tien Xuan Vo <[email protected]>
 */
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
    }
}

The same content is in 155 releases, Joomla 5.0.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.