| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | final protected static function getNewExceptionInstance($message, array $arguments = []) |
||
| 33 | { |
||
| 34 | $exceptionClassName = get_called_class(); |
||
| 35 | $methodName = ucfirst(debug_backtrace()[1]['function']); |
||
| 36 | $reflection = new ClassReflection($exceptionClassName); |
||
| 37 | $exceptionCode = end($reflection->getMethod($methodName)->getTagValues('code')); |
||
|
|
|||
| 38 | |||
| 39 | return new $exceptionClassName( |
||
| 40 | vsprintf($message, $arguments), |
||
| 41 | $exceptionCode |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |