2021-08-27 06:46:27 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* 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 <tien.xuan.vo@gmail.com>
|
|
|
|
*/
|
|
|
|
final class NullOutputFormatter implements OutputFormatterInterface
|
|
|
|
{
|
2023-02-24 06:26:40 -05:00
|
|
|
private NullOutputFormatterStyle $style;
|
2021-08-27 06:46:27 -04:00
|
|
|
|
2022-03-14 16:22:30 -04:00
|
|
|
public function format(?string $message): ?string
|
2021-08-27 06:46:27 -04:00
|
|
|
{
|
2022-03-14 16:22:30 -04:00
|
|
|
return null;
|
2021-08-27 06:46:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getStyle(string $name): OutputFormatterStyleInterface
|
|
|
|
{
|
|
|
|
// to comply with the interface we must return a OutputFormatterStyleInterface
|
2023-02-24 06:26:40 -05:00
|
|
|
return $this->style ??= new NullOutputFormatterStyle();
|
2021-08-27 06:46:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|