OutputFormatterStyleInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. public function setForeground(string $color = null);
  22. /**
  23. * Sets style background color.
  24. */
  25. public function setBackground(string $color = null);
  26. /**
  27. * Sets some specific style option.
  28. */
  29. public function setOption(string $option);
  30. /**
  31. * Unsets some specific style option.
  32. */
  33. public function unsetOption(string $option);
  34. /**
  35. * Sets multiple style options at once.
  36. */
  37. public function setOptions(array $options);
  38. /**
  39. * Applies the style to a given text.
  40. *
  41. * @return string
  42. */
  43. public function apply(string $text);
  44. }