| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function stringify($value): string |
||
| 44 | { |
||
| 45 | if ($value instanceof \DateTimeInterface) { |
||
| 46 | return $value->format('Y-m-d'); |
||
| 47 | } |
||
| 48 | |||
| 49 | if (is_array($value)) { |
||
| 50 | return self::ARRAY_VALUE; |
||
| 51 | } |
||
| 52 | |||
| 53 | if (is_object($value) && !method_exists($value, '__tostring')) { |
||
| 54 | return self::OBJECT_VALUE; |
||
| 55 | } |
||
| 56 | |||
| 57 | return (string)$value; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |