PageRenderTime 23ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/filp/whoops/src/Whoops/RunInterface.php

https://gitlab.com/madwanz64/laravel
PHP | 140 lines | 25 code | 17 blank | 98 comment | 0 complexity | 0f7218deb3da776703c14200cb33bb5b MD5 | raw file
  1. <?php
  2. /**
  3. * Whoops - php errors for cool kids
  4. * @author Filipe Dobreira <http://github.com/filp>
  5. */
  6. namespace Whoops;
  7. use InvalidArgumentException;
  8. use Whoops\Exception\ErrorException;
  9. use Whoops\Handler\HandlerInterface;
  10. interface RunInterface
  11. {
  12. const EXCEPTION_HANDLER = "handleException";
  13. const ERROR_HANDLER = "handleError";
  14. const SHUTDOWN_HANDLER = "handleShutdown";
  15. /**
  16. * Pushes a handler to the end of the stack
  17. *
  18. * @throws InvalidArgumentException If argument is not callable or instance of HandlerInterface
  19. * @param Callable|HandlerInterface $handler
  20. * @return Run
  21. */
  22. public function pushHandler($handler);
  23. /**
  24. * Removes the last handler in the stack and returns it.
  25. * Returns null if there"s nothing else to pop.
  26. *
  27. * @return null|HandlerInterface
  28. */
  29. public function popHandler();
  30. /**
  31. * Returns an array with all handlers, in the
  32. * order they were added to the stack.
  33. *
  34. * @return array
  35. */
  36. public function getHandlers();
  37. /**
  38. * Clears all handlers in the handlerStack, including
  39. * the default PrettyPage handler.
  40. *
  41. * @return Run
  42. */
  43. public function clearHandlers();
  44. /**
  45. * Registers this instance as an error handler.
  46. *
  47. * @return Run
  48. */
  49. public function register();
  50. /**
  51. * Unregisters all handlers registered by this Whoops\Run instance
  52. *
  53. * @return Run
  54. */
  55. public function unregister();
  56. /**
  57. * Should Whoops allow Handlers to force the script to quit?
  58. *
  59. * @param bool|int $exit
  60. * @return bool
  61. */
  62. public function allowQuit($exit = null);
  63. /**
  64. * Silence particular errors in particular files
  65. *
  66. * @param array|string $patterns List or a single regex pattern to match
  67. * @param int $levels Defaults to E_STRICT | E_DEPRECATED
  68. * @return \Whoops\Run
  69. */
  70. public function silenceErrorsInPaths($patterns, $levels = 10240);
  71. /**
  72. * Should Whoops send HTTP error code to the browser if possible?
  73. * Whoops will by default send HTTP code 500, but you may wish to
  74. * use 502, 503, or another 5xx family code.
  75. *
  76. * @param bool|int $code
  77. * @return int|false
  78. */
  79. public function sendHttpCode($code = null);
  80. /**
  81. * Should Whoops exit with a specific code on the CLI if possible?
  82. * Whoops will exit with 1 by default, but you can specify something else.
  83. *
  84. * @param int $code
  85. * @return int
  86. */
  87. public function sendExitCode($code = null);
  88. /**
  89. * Should Whoops push output directly to the client?
  90. * If this is false, output will be returned by handleException
  91. *
  92. * @param bool|int $send
  93. * @return bool
  94. */
  95. public function writeToOutput($send = null);
  96. /**
  97. * Handles an exception, ultimately generating a Whoops error
  98. * page.
  99. *
  100. * @param \Throwable $exception
  101. * @return string Output generated by handlers
  102. */
  103. public function handleException($exception);
  104. /**
  105. * Converts generic PHP errors to \ErrorException
  106. * instances, before passing them off to be handled.
  107. *
  108. * This method MUST be compatible with set_error_handler.
  109. *
  110. * @param int $level
  111. * @param string $message
  112. * @param string $file
  113. * @param int $line
  114. *
  115. * @return bool
  116. * @throws ErrorException
  117. */
  118. public function handleError($level, $message, $file = null, $line = null);
  119. /**
  120. * Special case to deal with Fatal errors and the like.
  121. */
  122. public function handleShutdown();
  123. }