| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class JsResponses |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Reload current page. |
||
| 11 | * |
||
| 12 | * @return string |
||
| 13 | */ |
||
| 14 | public static function reloadWindow(): string |
||
| 15 | { |
||
| 16 | return 'window.location.reload()'; |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Return a JavaScript alert with a message. |
||
| 21 | * |
||
| 22 | * @param string $msg |
||
| 23 | * @return string |
||
| 24 | */ |
||
| 25 | public static function jsAlert(string $msg): string |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Open a $url in a new tab. |
||
| 32 | * |
||
| 33 | * @param string $url |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | public static function jsOpenInNewTab(string $url): string |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Log a message to the client side Javascript console. |
||
| 43 | * |
||
| 44 | * @param string $message |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public static function consoleLog(string $message): string |
||
| 50 | } |
||
| 51 | } |
||
| 52 |