1 | <?php declare(strict_types=1); |
||
2 | |||
3 | namespace ShopwareBlogBugsnag\Source; |
||
4 | |||
5 | use Enlight\Event\SubscriberInterface; |
||
0 ignored issues
–
show
|
|||
6 | |||
7 | class BasicSubscriber implements SubscriberInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var BugsnagClient |
||
11 | */ |
||
12 | private $bugsnagClient; |
||
13 | |||
14 | public function __construct(BugsnagClient $bugsnagClient) |
||
15 | { |
||
16 | $this->bugsnagClient = $bugsnagClient; |
||
17 | } |
||
18 | |||
19 | public static function getSubscribedEvents(): array |
||
20 | { |
||
21 | return [ |
||
22 | 'Enlight_Controller_Front_RouteShutdown' => ['handleError', 1000], |
||
23 | 'Enlight_Controller_Front_PostDispatch' => ['handleError', 1000], |
||
24 | 'Shopware_Console_Add_Command' => ['handleError', 1000], |
||
25 | ]; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param \Enlight_Controller_EventArgs $args |
||
0 ignored issues
–
show
The type
Enlight_Controller_EventArgs was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
30 | */ |
||
31 | public function handleError(\Enlight_Event_EventArgs $args) |
||
0 ignored issues
–
show
The type
Enlight_Event_EventArgs was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
32 | { |
||
33 | $front = $args->getSubject(); |
||
34 | if ($front->getParam('noErrorHandler')) { |
||
35 | return; |
||
36 | } |
||
37 | |||
38 | $this->bugsnagClient->registerHandler(); |
||
39 | } |
||
40 | } |
||
41 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths