| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public static function new($value, string $format, string $error) : self |
||
| 15 | { |
||
| 16 | $actualType = is_object($value) ? get_class($value) : gettype($value); |
||
| 17 | |||
| 18 | return new self( |
||
| 19 | sprintf( |
||
| 20 | "Could not convert PHP type '%s' to '%s', as an '%s' error was triggered by the serialization", |
||
| 21 | $actualType, |
||
| 22 | $format, |
||
| 23 | $error |
||
| 24 | ) |
||
| 28 |