Conditions | 2 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | 38 | public static function withErrorHandlerForDOMDocument(callable $callback): mixed |
|
47 | { |
||
48 | 38 | return self::withErrorHandler(static function (int $code, string $message): bool { |
|
49 | 6 | if (str_contains($message, 'DOMDocument::')) { |
|
50 | 6 | throw new DOMException($message, $code); |
|
51 | } |
||
52 | |||
53 | return false; |
||
54 | 38 | }, $callback); |
|
55 | } |
||
71 |