Без опису

OutputFormatterInterface.php 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 interface for console output.
  13. *
  14. * @author Konstantin Kudryashov <ever.zet@gmail.com>
  15. */
  16. interface OutputFormatterInterface
  17. {
  18. /**
  19. * Sets the decorated flag.
  20. *
  21. * @param bool $decorated Whether to decorate the messages or not
  22. */
  23. public function setDecorated($decorated);
  24. /**
  25. * Gets the decorated flag.
  26. *
  27. * @return bool true if the output will decorate messages, false otherwise
  28. */
  29. public function isDecorated();
  30. /**
  31. * Sets a new style.
  32. *
  33. * @param string $name The style name
  34. */
  35. public function setStyle($name, OutputFormatterStyleInterface $style);
  36. /**
  37. * Checks if output formatter has style with specified name.
  38. *
  39. * @param string $name
  40. *
  41. * @return bool
  42. */
  43. public function hasStyle($name);
  44. /**
  45. * Gets style options from style with specified name.
  46. *
  47. * @param string $name
  48. *
  49. * @return OutputFormatterStyleInterface
  50. *
  51. * @throws \InvalidArgumentException When style isn't defined
  52. */
  53. public function getStyle($name);
  54. /**
  55. * Formats a message according to the given styles.
  56. *
  57. * @param string $message The message to style
  58. *
  59. * @return string The styled message
  60. */
  61. public function format($message);
  62. }