NullIO.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\IO;
  12. /**
  13. * IOInterface that is not interactive and never writes the output
  14. *
  15. * @author Christophe Coevoet <stof@notk.org>
  16. */
  17. class NullIO extends BaseIO
  18. {
  19. /**
  20. * {@inheritDoc}
  21. */
  22. public function isInteractive()
  23. {
  24. return false;
  25. }
  26. /**
  27. * {@inheritDoc}
  28. */
  29. public function isVerbose()
  30. {
  31. return false;
  32. }
  33. /**
  34. * {@inheritDoc}
  35. */
  36. public function isVeryVerbose()
  37. {
  38. return false;
  39. }
  40. /**
  41. * {@inheritDoc}
  42. */
  43. public function isDebug()
  44. {
  45. return false;
  46. }
  47. /**
  48. * {@inheritDoc}
  49. */
  50. public function isDecorated()
  51. {
  52. return false;
  53. }
  54. /**
  55. * {@inheritDoc}
  56. */
  57. public function write($messages, $newline = true)
  58. {
  59. }
  60. /**
  61. * {@inheritDoc}
  62. */
  63. public function writeError($messages, $newline = true)
  64. {
  65. }
  66. /**
  67. * {@inheritDoc}
  68. */
  69. public function overwrite($messages, $newline = true, $size = 80)
  70. {
  71. }
  72. /**
  73. * {@inheritDoc}
  74. */
  75. public function overwriteError($messages, $newline = true, $size = 80)
  76. {
  77. }
  78. /**
  79. * {@inheritDoc}
  80. */
  81. public function ask($question, $default = null)
  82. {
  83. return $default;
  84. }
  85. /**
  86. * {@inheritDoc}
  87. */
  88. public function askConfirmation($question, $default = true)
  89. {
  90. return $default;
  91. }
  92. /**
  93. * {@inheritDoc}
  94. */
  95. public function askAndValidate($question, $validator, $attempts = false, $default = null)
  96. {
  97. return $default;
  98. }
  99. /**
  100. * {@inheritDoc}
  101. */
  102. public function askAndHideAnswer($question)
  103. {
  104. return null;
  105. }
  106. }