OutputFormatterStyleInterface.php 1.3 KB

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