AlertProvider.php
1 year ago
ApiClient.php
1 year ago
DateTimeHelper.php
1 year ago
DateTimes.php
1 year ago
DateTimesImmutable.php
1 year ago
Debugger.php
1 year ago
DisplayHelper.php
1 year ago
EmailHelper.php
1 year ago
PostTypeHelper.php
1 year ago
Random.php
1 year ago
SecurityValidator.php
1 year ago
ShortcodeSubstitutor.php
1 year ago
TemplateProvider.php
1 year ago
functions.php
1 year ago
Debugger.php
21 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace FapiMember\Utils; |
| 4 | |
| 5 | final class Debugger |
| 6 | { |
| 7 | public static function consoleLog(mixed $data): void |
| 8 | { |
| 9 | $json = json_encode($data); |
| 10 | |
| 11 | if ($json === false) { |
| 12 | $json = 'JSON encoding error: ' . json_last_error_msg(); |
| 13 | } |
| 14 | |
| 15 | echo "<script> |
| 16 | console.log(" . $json . ") |
| 17 | </script>"; |
| 18 | } |
| 19 | |
| 20 | } |
| 21 |