Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | 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
    /**
688 lars 53
     * @return array<callable>
54
     */
55
    public function getFrameFilters();
56
 
57
    /**
58
     * @return Run
59
     */
60
    public function clearFrameFilters();
61
 
62
    /**
148 lars 63
     * Registers this instance as an error handler.
64
     *
65
     * @return Run
66
     */
67
    public function register();
68
 
69
    /**
70
     * Unregisters all handlers registered by this Whoops\Run instance
71
     *
72
     * @return Run
73
     */
74
    public function unregister();
75
 
76
    /**
77
     * Should Whoops allow Handlers to force the script to quit?
78
     *
79
     * @param  bool|int $exit
80
     * @return bool
81
     */
82
    public function allowQuit($exit = null);
83
 
84
    /**
85
     * Silence particular errors in particular files
86
     *
87
     * @param  array|string $patterns List or a single regex pattern to match
88
     * @param  int          $levels   Defaults to E_STRICT | E_DEPRECATED
89
     * @return \Whoops\Run
90
     */
91
    public function silenceErrorsInPaths($patterns, $levels = 10240);
92
 
93
    /**
94
     * Should Whoops send HTTP error code to the browser if possible?
95
     * Whoops will by default send HTTP code 500, but you may wish to
96
     * use 502, 503, or another 5xx family code.
97
     *
98
     * @param bool|int $code
99
     * @return int|false
100
     */
101
    public function sendHttpCode($code = null);
102
 
103
    /**
104
     * Should Whoops exit with a specific code on the CLI if possible?
105
     * Whoops will exit with 1 by default, but you can specify something else.
106
     *
107
     * @param int $code
108
     * @return int
109
     */
110
    public function sendExitCode($code = null);
111
 
112
    /**
113
     * Should Whoops push output directly to the client?
114
     * If this is false, output will be returned by handleException
115
     *
116
     * @param  bool|int $send
117
     * @return bool
118
     */
119
    public function writeToOutput($send = null);
120
 
121
    /**
122
     * Handles an exception, ultimately generating a Whoops error
123
     * page.
124
     *
125
     * @param  \Throwable $exception
126
     * @return string     Output generated by handlers
127
     */
128
    public function handleException($exception);
129
 
130
    /**
131
     * Converts generic PHP errors to \ErrorException
132
     * instances, before passing them off to be handled.
133
     *
134
     * This method MUST be compatible with set_error_handler.
135
     *
136
     * @param int    $level
137
     * @param string $message
138
     * @param string $file
139
     * @param int    $line
140
     *
141
     * @return bool
142
     * @throws ErrorException
143
     */
144
    public function handleError($level, $message, $file = null, $line = null);
145
 
146
    /**
147
     * Special case to deal with Fatal errors and the like.
148
     */
149
    public function handleShutdown();
688 lars 150
 
151
    /**
152
     * Registers a filter callback in the frame filters stack.
153
     *
154
     * @param callable $filterCallback
155
     * @return \Whoops\Run
156
     */
157
    public function addFrameFilter($filterCallback);
148 lars 158
}