Conditions | 4 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | private function createExceptionId(): string |
||
28 | { |
||
29 | $crc = crc32($this->exceptionClass); |
||
30 | $crcHex = dechex($crc & 0xFFFFFFFF); // Ensure positive hex value |
||
31 | |||
32 | // Use fixed ID in test environment for reproducible tests |
||
33 | if (defined('PHPUNIT_COMPOSER_INSTALL') || (isset($GLOBALS['_composer_autoload_path']) && str_contains($GLOBALS['_composer_autoload_path'], 'phpunit'))) { |
||
34 | static $counter = 0; |
||
35 | return 'e-bear-resource-test-' . sprintf('%03d', ++$counter) . '-' . $crcHex; |
||
36 | } |
||
37 | |||
38 | return 'e-bear-resource-' . uniqid() . '-' . $crcHex; |
||
39 | } |
||
41 |