Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 688
Zeile 4... Zeile 4...
4
 * @author Filipe Dobreira <http://github.com/filp>
4
 * @author Filipe Dobreira <http://github.com/filp>
5
 */
5
 */
Zeile 6... Zeile 6...
6
 
6
 
Zeile -... Zeile 7...
-
 
7
namespace Whoops\Exception;
-
 
8
 
7
namespace Whoops\Exception;
9
use Whoops\Inspector\InspectorFactory;
Zeile 8... Zeile 10...
8
 
10
use Whoops\Inspector\InspectorInterface;
9
use Whoops\Util\Misc;
11
use Whoops\Util\Misc;
10
 
12
 
11
class Inspector
13
class Inspector implements InspectorInterface
12
{
14
{
13
    /**
15
    /**
Zeile 29... Zeile 31...
29
     * @var \Throwable[]
31
     * @var \Throwable[]
30
     */
32
     */
31
    private $previousExceptions;
33
    private $previousExceptions;
Zeile 32... Zeile 34...
32
 
34
 
-
 
35
    /**
-
 
36
     * @var \Whoops\Inspector\InspectorFactoryInterface|null
-
 
37
     */
-
 
38
    protected $inspectorFactory;
-
 
39
 
33
    /**
40
    /**
-
 
41
     * @param \Throwable $exception The exception to inspect
34
     * @param \Throwable $exception The exception to inspect
42
     * @param \Whoops\Inspector\InspectorFactoryInterface $factory
35
     */
43
     */
36
    public function __construct($exception)
44
    public function __construct($exception, $factory = null)
37
    {
45
    {
-
 
46
        $this->exception = $exception;
38
        $this->exception = $exception;
47
        $this->inspectorFactory = $factory ?: new InspectorFactory();
Zeile 39... Zeile 48...
39
    }
48
    }
40
 
49
 
41
    /**
50
    /**
Zeile 135... Zeile 144...
135
    {
144
    {
136
        if ($this->previousExceptionInspector === null) {
145
        if ($this->previousExceptionInspector === null) {
137
            $previousException = $this->exception->getPrevious();
146
            $previousException = $this->exception->getPrevious();
Zeile 138... Zeile 147...
138
 
147
 
139
            if ($previousException) {
148
            if ($previousException) {
140
                $this->previousExceptionInspector = new Inspector($previousException);
149
                $this->previousExceptionInspector = $this->inspectorFactory->create($previousException);
141
            }
150
            }
Zeile 142... Zeile 151...
142
        }
151
        }
143
 
152
 
Zeile 165... Zeile 174...
165
    }
174
    }
Zeile 166... Zeile 175...
166
 
175
 
167
    /**
176
    /**
168
     * Returns an iterator for the inspected exception's
177
     * Returns an iterator for the inspected exception's
-
 
178
     * frames.
-
 
179
     * 
-
 
180
     * @param array<callable> $frameFilters
169
     * frames.
181
     * 
170
     * @return \Whoops\Exception\FrameCollection
182
     * @return \Whoops\Exception\FrameCollection
171
     */
183
     */
172
    public function getFrames()
184
    public function getFrames(array $frameFilters = [])
173
    {
185
    {
174
        if ($this->frames === null) {
186
        if ($this->frames === null) {
Zeile 175... Zeile 187...
175
            $frames = $this->getTrace($this->exception);
187
            $frames = $this->getTrace($this->exception);
Zeile 223... Zeile 235...
223
                    );
235
                    );
224
                }
236
                }
225
                $newFrames->prependFrames($outerFrames->topDiff($newFrames));
237
                $newFrames->prependFrames($outerFrames->topDiff($newFrames));
226
                $this->frames = $newFrames;
238
                $this->frames = $newFrames;
227
            }
239
            }
-
 
240
 
-
 
241
            // Apply frame filters callbacks on the frames stack
-
 
242
            if (!empty($frameFilters)) {
-
 
243
                foreach ($frameFilters as $filterCallback) {
-
 
244
                    $this->frames->filter($filterCallback);
-
 
245
                }
-
 
246
            }
228
        }
247
        }
Zeile 229... Zeile 248...
229
 
248
 
230
        return $this->frames;
249
        return $this->frames;
Zeile 299... Zeile 318...
299
 
318
 
300
    /**
319
    /**
301
     * Determine if the frame can be used to fill in previous frame's missing info
320
     * Determine if the frame can be used to fill in previous frame's missing info
302
     * happens for call_user_func and call_user_func_array usages (PHP Bug #44428)
321
     * happens for call_user_func and call_user_func_array usages (PHP Bug #44428)
303
     *
-
 
304
     * @param array $frame
322
     *
305
     * @return bool
323
     * @return bool
306
     */
324
     */
307
    protected function isValidNextFrame(array $frame)
325
    protected function isValidNextFrame(array $frame)
308
    {
326
    {