OutputFormatterStyleInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. * Formatter style interface for defining styles.
  13. *
  14. * @author Konstantin Kudryashov <ever.zet@gmail.com>
  15. */
  16. interface OutputFormatterStyleInterface
  17. {
  18. /**
  19. * Sets style foreground color.
  20. *
  21. * @return void
  22. */
  23. public function setForeground(?string $color);
  24. /**
  25. * Sets style background color.
  26. *
  27. * @return void
  28. */
  29. public function setBackground(?string $color);
  30. /**
  31. * Sets some specific style option.
  32. *
  33. * @return void
  34. */
  35. public function setOption(string $option);
  36. /**
  37. * Unsets some specific style option.
  38. *
  39. * @return void
  40. */
  41. public function unsetOption(string $option);
  42. /**
  43. * Sets multiple style options at once.
  44. *
  45. * @return void
  46. */
  47. public function setOptions(array $options);
  48. /**
  49. * Applies the style to a given text.
  50. */
  51. public function apply(string $text): string;
  52. }