Total Complexity | 10 |
Total Lines | 65 |
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 | protected $async = false; |
||
16 | |||
17 | public function __construct(string $token, Config $config = null) |
||
18 | { |
||
19 | $this->token = $token; |
||
20 | $this->sender = new Sender(); |
||
21 | $this->config = $config ?: new Config(); |
||
22 | } |
||
23 | |||
24 | public function sendAsync(bool $async): void |
||
25 | { |
||
26 | $this->async = $async; |
||
27 | } |
||
28 | |||
29 | public function getSender(): Sender |
||
30 | { |
||
31 | return $this->sender; |
||
32 | } |
||
33 | |||
34 | public function setConfig(Config $config): void |
||
35 | { |
||
36 | $this->config = $config; |
||
37 | } |
||
38 | |||
39 | public function getConfig(): Config |
||
42 | } |
||
43 | |||
44 | protected function getToken(): string |
||
45 | { |
||
46 | return $this->token; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Capture exception and return the event ID |
||
51 | * |
||
52 | * @param Throwable $exception |
||
53 | * @return string |
||
54 | */ |
||
55 | public function captureException(Throwable $exception): string |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * Log payload |
||
64 | * |
||
65 | * @param Payload $payload |
||
66 | * @return string |
||
67 | */ |
||
68 | public function log(Payload $payload): string |
||
74 |