OutputFormatterStyleInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 $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. * @param array $options
  46. */
  47. public function setOptions(array $options);
  48. /**
  49. * Applies the style to a given text.
  50. *
  51. * @param string $text The text to style
  52. *
  53. * @return string
  54. */
  55. public function apply($text);
  56. }