OutputFormatterStyleInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. * @api
  17. */
  18. interface OutputFormatterStyleInterface
  19. {
  20. /**
  21. * Sets style foreground color.
  22. *
  23. * @param string $color color name
  24. *
  25. * @api
  26. */
  27. function setForeground($color = null);
  28. /**
  29. * Sets style background color.
  30. *
  31. * @param string $color color name
  32. *
  33. * @api
  34. */
  35. function setBackground($color = null);
  36. /**
  37. * Sets some specific style option.
  38. *
  39. * @param string $option option name
  40. *
  41. * @api
  42. */
  43. function setOption($option);
  44. /**
  45. * Unsets some specific style option.
  46. *
  47. * @param string $option option name
  48. */
  49. function unsetOption($option);
  50. /**
  51. * Sets multiple style options at once.
  52. *
  53. * @param array $options
  54. */
  55. function setOptions(array $options);
  56. /**
  57. * Applies the style to a given text.
  58. *
  59. * @param string $text The text to style
  60. *
  61. * @return string
  62. */
  63. function apply($text);
  64. }