NullOutputFormatterStyle.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Console\Formatter;
  11. /**
  12. * @author Tien Xuan Vo <tien.xuan.vo@gmail.com>
  13. */
  14. final class NullOutputFormatterStyle implements OutputFormatterStyleInterface
  15. {
  16. public function apply(string $text): string
  17. {
  18. return $text;
  19. }
  20. public function setBackground(?string $color = null): void
  21. {
  22. if (1 > \func_num_args()) {
  23. trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
  24. }
  25. // do nothing
  26. }
  27. public function setForeground(?string $color = null): void
  28. {
  29. if (1 > \func_num_args()) {
  30. trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
  31. }
  32. // do nothing
  33. }
  34. public function setOption(string $option): void
  35. {
  36. // do nothing
  37. }
  38. public function setOptions(array $options): void
  39. {
  40. // do nothing
  41. }
  42. public function unsetOption(string $option): void
  43. {
  44. // do nothing
  45. }
  46. }