| Conditions | 9 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public static function normalize(mixed $value): mixed |
||
| 13 | { |
||
| 14 | if (null === $value || is_bool($value) || is_int($value) || is_float($value) || is_string($value)) { |
||
| 15 | return $value; |
||
| 16 | } |
||
| 17 | |||
| 18 | if ($value instanceof DateTimeInterface) { |
||
| 19 | return $value->format(DateTimeInterface::ATOM); |
||
| 20 | } |
||
| 21 | |||
| 22 | if (is_array($value)) { |
||
| 23 | return self::normalizeArray($value); |
||
| 24 | } |
||
| 25 | |||
| 26 | if (is_object($value)) { |
||
| 27 | return self::normalizeObject($value); |
||
| 28 | } |
||
| 29 | |||
| 30 | return null; |
||
| 31 | } |
||
| 72 |