NullIO.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 ask($question, $default = null)
  76. {
  77. return $default;
  78. }
  79. /**
  80. * {@inheritDoc}
  81. */
  82. public function askConfirmation($question, $default = true)
  83. {
  84. return $default;
  85. }
  86. /**
  87. * {@inheritDoc}
  88. */
  89. public function askAndValidate($question, $validator, $attempts = false, $default = null)
  90. {
  91. return $default;
  92. }
  93. /**
  94. * {@inheritDoc}
  95. */
  96. public function askAndHideAnswer($question)
  97. {
  98. return null;
  99. }
  100. }