StyleInterface.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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\Style;
  11. /**
  12. * Output style helpers.
  13. *
  14. * @author Kevin Bond <kevinbond@gmail.com>
  15. */
  16. interface StyleInterface
  17. {
  18. /**
  19. * Formats a command title.
  20. *
  21. * @return void
  22. * @param string $message
  23. */
  24. public function title($message);
  25. /**
  26. * Formats a section title.
  27. *
  28. * @return void
  29. * @param string $message
  30. */
  31. public function section($message);
  32. /**
  33. * Formats a list.
  34. *
  35. * @return void
  36. * @param mixed[] $elements
  37. */
  38. public function listing($elements);
  39. /**
  40. * Formats informational text.
  41. *
  42. * @return void
  43. * @param string|mixed[] $message
  44. */
  45. public function text($message);
  46. /**
  47. * Formats a success result bar.
  48. *
  49. * @return void
  50. * @param string|mixed[] $message
  51. */
  52. public function success($message);
  53. /**
  54. * Formats an error result bar.
  55. *
  56. * @return void
  57. * @param string|mixed[] $message
  58. */
  59. public function error($message);
  60. /**
  61. * Formats an warning result bar.
  62. *
  63. * @return void
  64. * @param string|mixed[] $message
  65. */
  66. public function warning($message);
  67. /**
  68. * Formats a note admonition.
  69. *
  70. * @return void
  71. * @param string|mixed[] $message
  72. */
  73. public function note($message);
  74. /**
  75. * Formats a caution admonition.
  76. *
  77. * @return void
  78. * @param string|mixed[] $message
  79. */
  80. public function caution($message);
  81. /**
  82. * Formats a table.
  83. *
  84. * @return void
  85. * @param mixed[] $headers
  86. * @param mixed[] $rows
  87. */
  88. public function table($headers, $rows);
  89. /**
  90. * Asks a question.
  91. * @return mixed
  92. * @param string $question
  93. * @param string|null $default
  94. * @param callable|null $validator
  95. */
  96. public function ask($question, $default = null, $validator = null);
  97. /**
  98. * Asks a question with the user input hidden.
  99. * @return mixed
  100. * @param string $question
  101. * @param callable|null $validator
  102. */
  103. public function askHidden($question, $validator = null);
  104. /**
  105. * Asks for confirmation.
  106. * @param string $question
  107. * @param bool $default
  108. */
  109. public function confirm($question, $default = true);
  110. /**
  111. * Asks a choice question.
  112. * @param mixed $default
  113. * @return mixed
  114. * @param string $question
  115. * @param mixed[] $choices
  116. */
  117. public function choice($question, $choices, $default = null);
  118. /**
  119. * Add newline(s).
  120. *
  121. * @return void
  122. * @param int $count
  123. */
  124. public function newLine($count = 1);
  125. /**
  126. * Starts the progress output.
  127. *
  128. * @return void
  129. * @param int $max
  130. */
  131. public function progressStart($max = 0);
  132. /**
  133. * Advances the progress output X steps.
  134. *
  135. * @return void
  136. * @param int $step
  137. */
  138. public function progressAdvance($step = 1);
  139. /**
  140. * Finishes the progress output.
  141. *
  142. * @return void
  143. */
  144. public function progressFinish();
  145. }