Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
12 | trait SharedLoggerTrait |
||
13 | { |
||
14 | /** |
||
15 | * Use the PSR logger trait, but make the methods protected so they aren't exposed via the Auth object. |
||
16 | */ |
||
17 | use PsrLoggerTrait { |
||
18 | emergency as protected; |
||
19 | alert as protected; |
||
20 | critical as protected; |
||
21 | error as protected; |
||
22 | warning as protected; |
||
23 | notice as protected; |
||
24 | info as protected; |
||
25 | debug as protected; |
||
26 | log as protected; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Logs with an arbitrary level, or don't if no logger has been set. |
||
31 | * |
||
32 | * @param mixed $level The log level. A LogLevel::* constant (usually) |
||
33 | * @param Stringable|string $message The message to log. |
||
34 | * @param array $context Further information about the context of the log message. |
||
35 | 2 | */ |
|
36 | protected function log($level, Stringable|string $message, array $context = []): void |
||
47 | 2 | } |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * Get the Auth class instance |
||
52 | * |
||
53 | * @return Auth |
||
54 | */ |
||
55 | abstract protected function getAuth(); |
||
56 | } |
||
57 |