| Total Complexity | 7 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 7 | class Logfile |
||
| 8 | { |
||
| 9 | protected $token; |
||
| 10 | |||
| 11 | protected $sender; |
||
| 12 | |||
| 13 | protected $config; |
||
| 14 | |||
| 15 | public function __construct(string $token, Config $config = null) |
||
| 16 | { |
||
| 17 | $this->token = $token; |
||
| 18 | $this->sender = new Sender(); |
||
| 19 | $this->config = $config ?: new Config(); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function setConfig(Config $config): void |
||
| 23 | { |
||
| 24 | $this->config = $config; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function getConfig(): Config |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function getToken(): string |
||
| 33 | { |
||
| 34 | return $this->token; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Capture exception and return the event ID |
||
| 39 | * |
||
| 40 | * @param Throwable $exception |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | public function captureException(Throwable $exception): string |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Log payload |
||
| 51 | * |
||
| 52 | * @param Payload $payload |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function log(Payload $payload): string |
||
| 61 |