@@ -29,29 +29,29 @@ |
||
| 29 | 29 | |
| 30 | 30 | class Registry implements IRegistry { |
| 31 | 31 | |
| 32 | - /** @var array<IReporter> */ |
|
| 33 | - private $reporters = []; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Register a reporter instance |
|
| 37 | - * |
|
| 38 | - * @param IReporter $reporter |
|
| 39 | - */ |
|
| 40 | - public function register(IReporter $reporter) { |
|
| 41 | - $this->reporters[] = $reporter; |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * Delegate crash reporting to all registered reporters |
|
| 46 | - * |
|
| 47 | - * @param Exception|Throwable $exception |
|
| 48 | - * @param array $context |
|
| 49 | - */ |
|
| 50 | - public function delegateReport($exception, array $context = []) { |
|
| 51 | - /** @var IReporter $reporter */ |
|
| 52 | - foreach ($this->reporters as $reporter) { |
|
| 53 | - $reporter->report($exception, $context); |
|
| 54 | - } |
|
| 55 | - } |
|
| 32 | + /** @var array<IReporter> */ |
|
| 33 | + private $reporters = []; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Register a reporter instance |
|
| 37 | + * |
|
| 38 | + * @param IReporter $reporter |
|
| 39 | + */ |
|
| 40 | + public function register(IReporter $reporter) { |
|
| 41 | + $this->reporters[] = $reporter; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * Delegate crash reporting to all registered reporters |
|
| 46 | + * |
|
| 47 | + * @param Exception|Throwable $exception |
|
| 48 | + * @param array $context |
|
| 49 | + */ |
|
| 50 | + public function delegateReport($exception, array $context = []) { |
|
| 51 | + /** @var IReporter $reporter */ |
|
| 52 | + foreach ($this->reporters as $reporter) { |
|
| 53 | + $reporter->report($exception, $context); |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | } |