OutputFormatterStyleInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. }