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 7... Zeile 7...
7
namespace Whoops;
7
namespace Whoops;
Zeile 8... Zeile 8...
8
 
8
 
9
use InvalidArgumentException;
9
use InvalidArgumentException;
10
use Throwable;
10
use Throwable;
11
use Whoops\Exception\ErrorException;
-
 
12
use Whoops\Exception\Inspector;
11
use Whoops\Exception\ErrorException;
13
use Whoops\Handler\CallbackHandler;
12
use Whoops\Handler\CallbackHandler;
14
use Whoops\Handler\Handler;
13
use Whoops\Handler\Handler;
-
 
14
use Whoops\Handler\HandlerInterface;
-
 
15
use Whoops\Inspector\CallableInspectorFactory;
-
 
16
use Whoops\Inspector\InspectorFactory;
-
 
17
use Whoops\Inspector\InspectorFactoryInterface;
15
use Whoops\Handler\HandlerInterface;
18
use Whoops\Inspector\InspectorInterface;
16
use Whoops\Util\Misc;
19
use Whoops\Util\Misc;
Zeile 17... Zeile 20...
17
use Whoops\Util\SystemFacade;
20
use Whoops\Util\SystemFacade;
18
 
21
 
Zeile 64... Zeile 67...
64
     *
67
     *
65
     * @var bool
68
     * @var bool
66
     */
69
     */
67
    private $canThrowExceptions = true;
70
    private $canThrowExceptions = true;
Zeile -... Zeile 71...
-
 
71
 
-
 
72
    /**
-
 
73
     * The inspector factory to create inspectors.
-
 
74
     *
-
 
75
     * @var InspectorFactoryInterface
-
 
76
     */
-
 
77
    private $inspectorFactory;
-
 
78
 
-
 
79
    /**
-
 
80
     * @var array<callable>
-
 
81
     */
-
 
82
    private $frameFilters = [];
68
 
83
 
69
    public function __construct(SystemFacade $system = null)
84
    public function __construct(SystemFacade $system = null)
70
    {
85
    {
-
 
86
        $this->system = $system ?: new SystemFacade;
71
        $this->system = $system ?: new SystemFacade;
87
        $this->inspectorFactory = new InspectorFactory();
Zeile 72... Zeile 88...
72
    }
88
    }
73
 
89
 
74
    /**
90
    /**
Zeile 163... Zeile 179...
163
    {
179
    {
164
        $this->handlerStack = [];
180
        $this->handlerStack = [];
165
        return $this;
181
        return $this;
166
    }
182
    }
Zeile -... Zeile 183...
-
 
183
 
-
 
184
    public function getFrameFilters()
-
 
185
    {
-
 
186
        return $this->frameFilters;
-
 
187
    }
-
 
188
 
-
 
189
    public function clearFrameFilters()
-
 
190
    {
-
 
191
        $this->frameFilters = [];
-
 
192
        return $this;
-
 
193
    }
167
 
194
 
168
    /**
195
    /**
169
     * Registers this instance as an error handler.
196
     * Registers this instance as an error handler.
170
     *
197
     *
171
     * @return Run
198
     * @return Run
Zeile 177... Zeile 204...
177
            // https://bugs.php.net/bug.php?id=42098
204
            // https://bugs.php.net/bug.php?id=42098
178
            class_exists("\\Whoops\\Exception\\ErrorException");
205
            class_exists("\\Whoops\\Exception\\ErrorException");
179
            class_exists("\\Whoops\\Exception\\FrameCollection");
206
            class_exists("\\Whoops\\Exception\\FrameCollection");
180
            class_exists("\\Whoops\\Exception\\Frame");
207
            class_exists("\\Whoops\\Exception\\Frame");
181
            class_exists("\\Whoops\\Exception\\Inspector");
208
            class_exists("\\Whoops\\Exception\\Inspector");
-
 
209
            class_exists("\\Whoops\\Inspector\\InspectorFactory");
Zeile 182... Zeile 210...
182
 
210
 
183
            $this->system->setErrorHandler([$this, self::ERROR_HANDLER]);
211
            $this->system->setErrorHandler([$this, self::ERROR_HANDLER]);
184
            $this->system->setExceptionHandler([$this, self::EXCEPTION_HANDLER]);
212
            $this->system->setExceptionHandler([$this, self::EXCEPTION_HANDLER]);
Zeile 486... Zeile 514...
486
                $error['line']
514
                $error['line']
487
            );
515
            );
488
        }
516
        }
489
    }
517
    }
Zeile -... Zeile 518...
-
 
518
 
-
 
519
 
-
 
520
    /**
-
 
521
     * @param InspectorFactoryInterface $factory
-
 
522
     *
-
 
523
     * @return void
-
 
524
     */
-
 
525
    public function setInspectorFactory(InspectorFactoryInterface $factory)
-
 
526
    {
-
 
527
        $this->inspectorFactory = $factory;
-
 
528
    }
-
 
529
 
-
 
530
    public function addFrameFilter($filterCallback)
-
 
531
    {
-
 
532
        if (!is_callable($filterCallback)) {
-
 
533
            throw new \InvalidArgumentException(sprintf(
-
 
534
                "A frame filter must be of type callable, %s type given.", 
-
 
535
                gettype($filterCallback)
-
 
536
            ));
-
 
537
        }
-
 
538
 
-
 
539
        $this->frameFilters[] = $filterCallback;
-
 
540
        return $this;
-
 
541
    }
490
 
542
 
491
    /**
543
    /**
492
     * @param Throwable $exception
544
     * @param Throwable $exception
493
     *
545
     *
494
     * @return Inspector
546
     * @return InspectorInterface
495
     */
547
     */
496
    private function getInspector($exception)
548
    private function getInspector($exception)
497
    {
549
    {
498
        return new Inspector($exception);
550
        return $this->inspectorFactory->create($exception);
Zeile 499... Zeile 551...
499
    }
551
    }
500
 
552
 
501
    /**
553
    /**