These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace PragmaRX\Health\Checkers; |
||
4 | |||
5 | use PragmaRX\Health\Support\Result; |
||
6 | use SensioLabs\Security\SecurityChecker as SensioLabsSecurityChecker; |
||
7 | |||
8 | class SecurityChecker extends Base |
||
9 | { |
||
10 | /** |
||
11 | * Check resource. |
||
12 | * |
||
13 | * @return Result |
||
14 | */ |
||
15 | 1 | public function check() |
|
16 | { |
||
17 | 1 | $checker = new SensioLabsSecurityChecker(); |
|
18 | |||
19 | 1 | $alerts = $checker->check(base_path('composer.lock')); |
|
20 | |||
21 | if (count($alerts) == 0) { |
||
22 | return $this->makeHealthyResult(); |
||
23 | } |
||
24 | |||
25 | $problems = collect($alerts) |
||
26 | ->keys() |
||
27 | ->implode(', '); |
||
28 | |||
29 | return $this->makeResult( |
||
30 | $isHealthy, |
||
0 ignored issues
–
show
|
|||
31 | sprintf($this->target->getErrorMessage(), $problems) |
||
32 | ); |
||
33 | } |
||
34 | } |
||
35 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.