@@ -169,12 +169,14 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | protected function getIncludedFiles(): array |
| 171 | 171 | { |
| 172 | - $files = array_values(array_filter(get_included_files(), function ($file) { |
|
| 172 | + $files = array_values(array_filter(get_included_files(), function ($file) |
|
| 173 | + { |
|
| 173 | 174 | $bool = false !== strpos($file, '/themes/') |
| 174 | 175 | && false === strpos($file, '/functions.php'); |
| 175 | 176 | return (bool) apply_filters('blackbar/templates/file', $bool, $file); |
| 176 | 177 | })); |
| 177 | - return array_map(function ($key, $value) { |
|
| 178 | + return array_map(function ($key, $value) |
|
| 179 | + { |
|
| 178 | 180 | $value = str_replace(trailingslashit(WP_CONTENT_DIR), '', $value); |
| 179 | 181 | return sprintf('[%s] => %s', $key, $value); |
| 180 | 182 | }, array_keys($files), $files); |
@@ -198,7 +200,8 @@ discard block |
||
| 198 | 200 | 'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LEFT JOIN', 'LIMIT', |
| 199 | 201 | 'ON DUPLICATE KEY UPDATE', 'ORDER BY', 'OFFSET', ' SET', 'WHERE', |
| 200 | 202 | ]; |
| 201 | - $replace = array_map(function ($value) { |
|
| 203 | + $replace = array_map(function ($value) |
|
| 204 | + { |
|
| 202 | 205 | return PHP_EOL.$value; |
| 203 | 206 | }, $search); |
| 204 | 207 | foreach ($wpdb->queries as $query) { |
@@ -37,7 +37,8 @@ discard block |
||
| 37 | 37 | if (array_key_exists($errno, static::MAPPED_ERROR_CODES)) { |
| 38 | 38 | $errname = ucfirst($errno); |
| 39 | 39 | $errno = static::MAPPED_ERROR_CODES[$errno]; |
| 40 | - } elseif (array_key_exists($errno, static::ERROR_CODES)) { |
|
| 40 | + } |
|
| 41 | + elseif (array_key_exists($errno, static::ERROR_CODES)) { |
|
| 41 | 42 | $errname = static::ERROR_CODES[$errno]; |
| 42 | 43 | } |
| 43 | 44 | $this->entries[] = [ |
@@ -63,9 +64,11 @@ discard block |
||
| 63 | 64 | { |
| 64 | 65 | if ($value instanceof DateTime) { |
| 65 | 66 | $value = $value->format('Y-m-d H:i:s'); |
| 66 | - } elseif ($this->isObjectOrArray($value)) { |
|
| 67 | + } |
|
| 68 | + elseif ($this->isObjectOrArray($value)) { |
|
| 67 | 69 | $value = print_r(json_decode(json_encode($value)), true); |
| 68 | - } elseif (is_resource($value)) { |
|
| 70 | + } |
|
| 71 | + elseif (is_resource($value)) { |
|
| 69 | 72 | $value = (string) $value; |
| 70 | 73 | } |
| 71 | 74 | return esc_html($value); |
@@ -33,7 +33,8 @@ discard block |
||
| 33 | 33 | $hash = md5($errno.$message.$file.$line); |
| 34 | 34 | if (array_key_exists($hash, $this->errors)) { |
| 35 | 35 | ++$this->errors[$hash]['count']; |
| 36 | - } else { |
|
| 36 | + } |
|
| 37 | + else { |
|
| 37 | 38 | $this->errors[$hash] = [ |
| 38 | 39 | 'count' => 0, |
| 39 | 40 | 'errno' => $errno, |
@@ -52,7 +53,8 @@ discard block |
||
| 52 | 53 | add_filter('all', [$controller, 'initProfiler']); |
| 53 | 54 | add_filter('all', [$controller, 'measureSlowActions']); |
| 54 | 55 | add_action('plugins_loaded', [$controller, 'registerLanguages']); |
| 55 | - add_action('init', function () use ($controller) { |
|
| 56 | + add_action('init', function () use ($controller) |
|
| 57 | + { |
|
| 56 | 58 | if (!apply_filters('blackbar/enabled', current_user_can('administrator'))) { |
| 57 | 59 | return; |
| 58 | 60 | } |