OutputInterface.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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\Output;
  11. use Symfony\Component\Console\Formatter\OutputFormatterInterface;
  12. /**
  13. * OutputInterface is the interface implemented by all Output classes.
  14. *
  15. * @author Fabien Potencier <fabien@symfony.com>
  16. */
  17. interface OutputInterface
  18. {
  19. /**
  20. * Writes a message to the output.
  21. *
  22. * @param string|array $messages The message as an array of lines of a single string
  23. * @param Boolean $newline Whether to add a newline or not
  24. * @param integer $type The type of output
  25. *
  26. * @throws \InvalidArgumentException When unknown output type is given
  27. */
  28. function write($messages, $newline = false, $type = 0);
  29. /**
  30. * Writes a message to the output and adds a newline at the end.
  31. *
  32. * @param string|array $messages The message as an array of lines of a single string
  33. * @param integer $type The type of output
  34. */
  35. function writeln($messages, $type = 0);
  36. /**
  37. * Sets the verbosity of the output.
  38. *
  39. * @param integer $level The level of verbosity
  40. */
  41. function setVerbosity($level);
  42. /**
  43. * Sets the decorated flag.
  44. *
  45. * @param Boolean $decorated Whether to decorated the messages or not
  46. */
  47. function setDecorated($decorated);
  48. /**
  49. * Sets output formatter.
  50. *
  51. * @param OutputFormatterInterface $formatter
  52. */
  53. function setFormatter(OutputFormatterInterface $formatter);
  54. /**
  55. * Returns current output formatter instance.
  56. *
  57. * @return OutputFormatterInterface
  58. */
  59. function getFormatter();
  60. }