Total Complexity | 10 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | class DebugBarUtils |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * Format a sql query string using available formatters. |
||
13 | * If no formatters are available, simply return the string as is. |
||
14 | * Highlighting is used if not in cli context |
||
15 | */ |
||
16 | public static function formatSql(string $query): string |
||
17 | { |
||
18 | if (class_exists(\Doctrine\SqlFormatter\SqlFormatter::class)) { |
||
19 | return (new \Doctrine\SqlFormatter\SqlFormatter())->format($query); |
||
20 | } |
||
21 | if (class_exists(\SqlFormatter::class)) { |
||
|
|||
22 | return \SqlFormatter::format($query, !self::isCli()); |
||
23 | } |
||
24 | if (class_exists(\SilverStripe\View\Parsers\SQLFormatter::class)) { |
||
25 | $method = self::isCli() ? 'formatPlain' : 'formatHTML'; |
||
26 | $formatter = new \SilverStripe\View\Parsers\SQLFormatter; |
||
27 | return $formatter->$method($query); |
||
28 | } |
||
29 | return $query; |
||
30 | } |
||
31 | |||
32 | public static function formatListQuery(DataList $list, bool $inline = true): string |
||
40 | } |
||
41 | |||
42 | public static function isCli(): bool |
||
45 | } |
||
46 | } |
||
47 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths