| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | trait JsonMethods |
||
| 23 | { |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Clears the title of a Throwable object. |
||
| 27 | * |
||
| 28 | * @param Throwable $throwable The Throwable object to extract the title from. |
||
| 29 | * @return string The cleared title. |
||
| 30 | */ |
||
| 31 | private function clearTitle(Throwable $throwable): string |
||
| 32 | { |
||
| 33 | $parts = explode('\\', get_class($throwable)); |
||
| 34 | $name = array_pop($parts); |
||
| 35 | return ucfirst(trim(strtolower(implode(' ', preg_split('/(?=[A-Z])/', $name))))); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Generates details based on the Throwable object and ExceptionInspector. |
||
| 40 | * |
||
| 41 | * @param Throwable $throwable The Throwable object used to retrieve error message. |
||
| 42 | * @param ExceptionInspector $inspector The ExceptionInspector object to provide additional information. |
||
| 43 | * @return string The generated details based on the Throwable and ExceptionInspector. |
||
| 44 | */ |
||
| 45 | private function details(Throwable $throwable, ExceptionInspector $inspector): string |
||
| 49 | } |
||
| 50 | } |
||
| 51 |