1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This file is part of the Laravel Lodash package. |
4
|
|
|
* |
5
|
|
|
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
declare(strict_types=1); |
11
|
|
|
|
12
|
|
|
if (! function_exists('p')) { |
13
|
|
|
function p(...$values): void |
14
|
|
|
{ |
15
|
|
|
/** @var \Barryvdh\Debugbar\LaravelDebugbar $debugbar */ |
16
|
|
|
$debugbar = app('debugbar'); |
17
|
|
|
foreach ($values as $value) { |
18
|
|
|
$debugbar->addMessage($value, 'debug'); |
19
|
|
|
} |
20
|
|
|
} |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
if (! function_exists('get_db_query')) { |
24
|
|
|
function get_db_query(): ?string |
25
|
|
|
{ |
26
|
|
|
if (! app()->bound('debugbar')) { |
27
|
|
|
return null; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** @var \Barryvdh\Debugbar\LaravelDebugbar $debugbar */ |
31
|
|
|
$debugbar = app('debugbar'); |
32
|
|
|
|
33
|
|
|
$queries = $debugbar->getCollector('queries')->collect(); |
34
|
|
|
if (empty($queries['statements'])) { |
35
|
|
|
return null; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
$query = end($queries['statements']); |
39
|
|
|
|
40
|
|
|
return $query['sql']; |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
if (! function_exists('get_db_queries')) { |
45
|
|
|
function get_db_queries(): ?array |
46
|
|
|
{ |
47
|
|
|
if (! app()->bound('debugbar')) { |
48
|
|
|
return null; |
49
|
|
|
} |
50
|
|
|
/** @var \Barryvdh\Debugbar\LaravelDebugbar $debugbar */ |
51
|
|
|
$debugbar = app('debugbar'); |
52
|
|
|
|
53
|
|
|
try { |
54
|
|
|
$collector = $debugbar->getCollector('queries'); |
55
|
|
|
} catch (DebugBarException $e) { |
|
|
|
|
56
|
|
|
return null; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
$queries = $collector->collect(); |
60
|
|
|
if (empty($queries['statements'])) { |
61
|
|
|
return null; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
$list = []; |
65
|
|
|
foreach ($queries['statements'] as $query) { |
66
|
|
|
$list[] = $query['sql']; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
return $list; |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.