@@ -26,7 +26,8 @@ |
||
26 | 26 | if (!empty($this->hooks)) { |
27 | 27 | return $this->hooks; |
28 | 28 | } |
29 | - array_walk($this->entries, function (&$data) { |
|
29 | + array_walk($this->entries, function (&$data) |
|
30 | + { |
|
30 | 31 | $total = $this->totalTimeForHook($data); |
31 | 32 | $perCall = (int) round($total / $data['count']); |
32 | 33 | $data['per_call'] = $this->formatTime($perCall); |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | 'FROM', 'GROUP BY', 'INNER JOIN', 'LEFT JOIN', 'LIMIT', |
14 | 14 | 'ON DUPLICATE KEY UPDATE', 'ORDER BY', 'OFFSET', ' SET', 'WHERE', |
15 | 15 | ]; |
16 | - $replace = array_map(function ($value) { |
|
16 | + $replace = array_map(function ($value) |
|
17 | + { |
|
17 | 18 | return PHP_EOL.$value; |
18 | 19 | }, $search); |
19 | 20 | foreach ($wpdb->queries as $query) { |
@@ -22,7 +23,8 @@ discard block |
||
22 | 23 | $sql = str_replace(['( ', ' )', ' ,'], ['(', ')', ','], $sql); |
23 | 24 | $sql = str_replace($search, $replace, $sql); |
24 | 25 | $parts = explode(PHP_EOL, $sql); |
25 | - $sql = array_reduce($parts, function ($carry, $part) { |
|
26 | + $sql = array_reduce($parts, function ($carry, $part) |
|
27 | + { |
|
26 | 28 | if (str_starts_with($part, 'SELECT') && strlen($part) > 100) { |
27 | 29 | $part = preg_replace('/\s*(,)\s*/', ','.PHP_EOL.' ', $part); |
28 | 30 | } |
@@ -2,7 +2,8 @@ |
||
2 | 2 | |
3 | 3 | defined('WPINC') || exit; |
4 | 4 | |
5 | -spl_autoload_register(function ($className) { |
|
5 | +spl_autoload_register(function ($className) |
|
6 | +{ |
|
6 | 7 | $namespaces = [ |
7 | 8 | 'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/', |
8 | 9 | 'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/', |