| Conditions | 5 |
| Paths | 12 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5.0144 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 4 | public static function assertDocumentDivider(int $value, string $message = '') |
|
| 29 | { |
||
| 30 | 4 | $haystack = []; |
|
| 31 | try { |
||
| 32 | 4 | $reportingCloud = new ReportingCloud(); |
|
| 33 | 4 | $reflectionClass = new ReflectionClass($reportingCloud); |
|
| 34 | 4 | foreach ($reflectionClass->getConstants() as $constantKey => $constantValue) { |
|
| 35 | 4 | if (0 === strpos($constantKey, 'DOCUMENT_DIVIDER_')) { |
|
| 36 | 4 | $haystack[] = $constantValue; |
|
| 37 | } |
||
| 38 | } |
||
| 39 | 4 | unset($reportingCloud); |
|
| 40 | } catch (ReflectionException $e) { |
||
| 41 | // continue |
||
| 42 | } |
||
| 43 | |||
| 44 | 4 | $format = '%s contains an unsupported document divider'; |
|
| 45 | 4 | $message = sprintf($message ?: $format, static::valueToString($value)); |
|
| 46 | |||
| 47 | 4 | return static::oneOf($value, $haystack, $message); |
|
| 48 | } |
||
| 50 |