| Total Complexity | 12 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class JavascriptUtils { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Returns a JSON string from an object. |
||
| 17 | * |
||
| 18 | * @param mixed $object |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | 2 | public static function toJSON($object): string { |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Return a javascript object from a php associative array. |
||
| 34 | * |
||
| 35 | * @param array $array |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | 1 | public static function arrayToJsObject(array $array): string { |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Add script tags to a javascript code. |
||
| 53 | * |
||
| 54 | * @param string $script |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | 1 | public static function wrapScript(string $script): string { |
|
| 68 |