Subversion-Projekte lars-tiefland.laravel_shop

Revision

Zur aktuellen Revision | Details | Letzte Änderung | Log anzeigen | RSS feed

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