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 |
|
106 | |||
107 | /** |
||
108 | * @return Notifier |
||
109 | */ |
||
110 | 1 | public function getNotifier(): Notifier |
|
114 | |||
115 | /** |
||
116 | * @return ErrorHandler|null |
||
117 | */ |
||
118 | 2 | public function getErrorHandler() |
|
122 | |||
123 | /** |
||
124 | * Add a global exception instance if applicable. |
||
125 | * |
||
126 | * @param bool $globalExceptionInstance |
||
127 | * |
||
128 | * @return AirbrakeService |
||
129 | */ |
||
130 | 4 | protected function withGlobalExceptionInstance(bool $globalExceptionInstance): AirbrakeService |
|
138 | |||
139 | /** |
||
140 | * Add a global error and exception handler if applicable. |
||
141 | * |
||
142 | * @param bool $globalErrorAndExceptionHandler |
||
143 | * |
||
144 | * @return AirbrakeService |
||
145 | */ |
||
146 | 4 | protected function withGlobalErrorAndExceptionHandler(bool $globalErrorAndExceptionHandler): AirbrakeService |
|
155 | } |
||
156 |