GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 9e170a...fa9406 )
by Freek
04:03
created

CheckSslCertificates::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\UptimeMonitor\Commands;
4
5
use Spatie\SslCertificate\SslCertificate;
6
use Spatie\UptimeMonitor\Models\Site;
7
use Spatie\UptimeMonitor\Services\PingMonitors\UptimeMonitorCollection;
8
use Spatie\UptimeMonitor\SiteRepository;
9
10
class CheckSslCertificates extends BaseCommand
11
{
12
    /**
13
     * The name and signature of the console command.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'uptime-monitor:check-ssl';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Check the ssl certificates of all sites';
25
26
    public function handle()
27
    {
28
        $sites = SiteRepository::getAllForSslCheck();
29
30
        $this->comment('Start checking the ssl certificate of '.count($sites).' sites...');
31
32
        SiteRepository::getAllForSslCheck()->each(function(Site $site) {
33
            $this->info("Checking ssl-certificate of {$site->url}");
34
35
            $certificate = SslCertificate::createForHostName($site->url->getHost());
0 ignored issues
show
Unused Code introduced by
$certificate is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
36
        });
37
38
        $this->info('All done!');
39
    }
40
}
41