1 | <?php |
||
19 | class AirbrakeService |
||
20 | { |
||
21 | /** |
||
22 | * Notifier that has been set up with configuration parameters |
||
23 | * and filters. |
||
24 | * |
||
25 | * @var Notifier |
||
26 | */ |
||
27 | protected $notifier; |
||
28 | |||
29 | /** |
||
30 | * The global error and exception handler instance. |
||
31 | * Defaults to null if the global_error_and_exception_handler |
||
32 | * configuration is set to false. |
||
33 | * |
||
34 | * @var ErrorHandler |
||
35 | */ |
||
36 | protected $errorHandler; |
||
37 | |||
38 | /** |
||
39 | * AirbrakeService constructor. |
||
40 | * |
||
41 | * @param NotifierBuilder $notifierBuilder |
||
42 | * @param string $projectId |
||
43 | * @param string $projectKey |
||
44 | * @param bool $globalExceptionInstance |
||
45 | * @param bool $globalErrorAndExceptionHandler |
||
46 | * @param string $host |
||
47 | * @param string $httpClient |
||
48 | * @param string $rootDirectory |
||
49 | * @param array $ignoredExceptions |
||
50 | * @param string $environment |
||
51 | * @param string $appVersion |
||
52 | */ |
||
53 | 5 | public function __construct( |
|
83 | |||
84 | /** |
||
85 | * Notify Airbrake of the exception. |
||
86 | * |
||
87 | * @param \Exception $exception |
||
88 | * |
||
89 | * @return bool |
||
90 | * @throws AirbrakeConnectionException |
||
91 | */ |
||
92 | 2 | public function notify(\Exception $exception): bool |
|
102 | |||
103 | /** |
||
104 | * @return Notifier |
||
105 | */ |
||
106 | 1 | public function getNotifier(): Notifier |
|
110 | |||
111 | /** |
||
112 | * @return ErrorHandler|null |
||
113 | */ |
||
114 | 2 | public function getErrorHandler() |
|
118 | |||
119 | /** |
||
120 | * Add a global exception instance if applicable. |
||
121 | * |
||
122 | * @param bool $globalExceptionInstance |
||
123 | * |
||
124 | * @return AirbrakeService |
||
125 | */ |
||
126 | 4 | protected function withGlobalExceptionInstance(bool $globalExceptionInstance): AirbrakeService |
|
134 | |||
135 | /** |
||
136 | * Add a global error and exception handler if applicable. |
||
137 | * |
||
138 | * @param bool $globalErrorAndExceptionHandler |
||
139 | * |
||
140 | * @return AirbrakeService |
||
141 | */ |
||
142 | 4 | protected function withGlobalErrorAndExceptionHandler(bool $globalErrorAndExceptionHandler): AirbrakeService |
|
151 | } |
||
152 |