@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | public static function consoleDebug($data, $postpone = true, $title = 'PHP', $logType = 'log') |
| 23 | 23 | { |
| 24 | 24 | if (in_array($logType, ['log', 'error', 'trace'])) { |
| 25 | - $title .= '(' . self::getCallerFile(2) .'):'; |
|
| 25 | + $title .= '(' . self::getCallerFile(2) . '):'; |
|
| 26 | 26 | $type = gettype($data); |
| 27 | 27 | $output = json_encode($data); |
| 28 | - $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
| 28 | + $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
| 29 | 29 | self::echoDebug($result, $postpone); |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | protected static function echoDebug($data, $postpone) |
| 47 | 47 | { |
| 48 | 48 | if ($postpone) { |
| 49 | - add_action('wp_footer', function () use ($data) { |
|
| 49 | + add_action('wp_footer', function() use ($data) { |
|
| 50 | 50 | echo $data; |
| 51 | 51 | }, 30); |
| 52 | 52 | } else { |
@@ -5,14 +5,14 @@ discard block |
||
| 5 | 5 | class ArrayHelpers |
| 6 | 6 | { |
| 7 | 7 | /** |
| 8 | - * Checks if an array is associative. |
|
| 9 | - * |
|
| 10 | - * @since 0.1.0 |
|
| 11 | - * |
|
| 12 | - * @param array $array The array to check. |
|
| 13 | - * |
|
| 14 | - * @return boolean |
|
| 15 | - */ |
|
| 8 | + * Checks if an array is associative. |
|
| 9 | + * |
|
| 10 | + * @since 0.1.0 |
|
| 11 | + * |
|
| 12 | + * @param array $array The array to check. |
|
| 13 | + * |
|
| 14 | + * @return boolean |
|
| 15 | + */ |
|
| 16 | 16 | public static function isAssoc(array $array) |
| 17 | 17 | { |
| 18 | 18 | // Keys of the array |
@@ -24,14 +24,14 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * Converts indexed values to associative keys. |
|
| 28 | - * |
|
| 29 | - * @since 0.1.0 |
|
| 30 | - * |
|
| 31 | - * @param array $array The array to convert. |
|
| 32 | - * |
|
| 33 | - * @return array |
|
| 34 | - */ |
|
| 27 | + * Converts indexed values to associative keys. |
|
| 28 | + * |
|
| 29 | + * @since 0.1.0 |
|
| 30 | + * |
|
| 31 | + * @param array $array The array to convert. |
|
| 32 | + * |
|
| 33 | + * @return array |
|
| 34 | + */ |
|
| 35 | 35 | public static function indexedValuesToAssocKeys(array $array) |
| 36 | 36 | { |
| 37 | 37 | $values = array_map(function ($value) { |
@@ -34,11 +34,11 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public static function indexedValuesToAssocKeys(array $array) |
| 36 | 36 | { |
| 37 | - $values = array_map(function ($value) { |
|
| 37 | + $values = array_map(function($value) { |
|
| 38 | 38 | return is_array($value) ? $value : []; |
| 39 | 39 | }, $array); |
| 40 | 40 | |
| 41 | - $keys = array_map(function ($key) use ($array) { |
|
| 41 | + $keys = array_map(function($key) use ($array) { |
|
| 42 | 42 | return is_int($key) ? $array[$key] : $key; |
| 43 | 43 | }, array_keys($array)); |
| 44 | 44 | |