Completed
Push — master ( bd46cd...e5e974 )
by Antonio Carlos
10:27 queued 06:13
created

src/Checkers/SecurityChecker.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

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
The variable $isHealthy does not exist. Did you forget to declare it?

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.

Loading history...
31
            sprintf($this->target->getErrorMessage(), $problems)
32
        );
33
    }
34
}
35