| Total Complexity | 5 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | final class LogRef implements Stringable |
||
| 20 | { |
||
| 21 | private string $ref; |
||
| 22 | |||
| 23 | public function __construct(Throwable $e) |
||
| 24 | { |
||
| 25 | // phpcs:ignore SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFallbackGlobalName |
||
| 26 | $this->ref = hash('crc32b', $e::class . $e->getMessage() . $e->getFile() . $e->getLine()); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function __toString(): string |
||
| 30 | { |
||
| 31 | return $this->ref; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function log(Throwable $e, RouterMatch $request, AbstractAppMeta $appMeta): void |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
If you suppress an error, we recommend checking for the error condition explicitly: