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 ( b905f6...efedee )
by Freek
01:58
created

SitesWithSslProblems::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\UptimeMonitor\Commands\UptimeMonitorLists;
4
5
use Illuminate\Console\Command;
6
use Spatie\UptimeMonitor\Helpers\Emoji;
7
use Spatie\UptimeMonitor\Models\Site;
8
use Spatie\UptimeMonitor\SiteRepository;
9
10
class SitesWithSslProblems
11
{
12
    protected $output;
13
14
    public function __construct(Command $output)
15
    {
16
        $this->output = $output;
17
    }
18
19
    public function display()
20
    {
21
        $sitesWithSslProblems = SiteRepository::withSslProblems();
22
23
        if (! $sitesWithSslProblems->count()) {
24
            return;
25
        }
26
27
        $this->output->info('Sites with ssl problems');
28
        $this->output->info('=======================');
29
30
        $rows = $sitesWithSslProblems->map(function (Site $site) {
31
            $url = $site->url;
32
33
            $reachable = $site->reachableAsEmoji;
34
35
            $sslCertificateFound = Emoji::notOk();
36
            $sslCertificateExpirationDate = $site->formattedSslCertificateExpirationDate;
37
            $sslCertificateIssuer = $site->ssl_certificate_issuer ?? 'Unknown';
38
39
40
            return compact('url', 'reachable', 'sslCertificateFound', 'sslCertificateExpirationDate', 'sslCertificateIssuer');
41
        });
42
43
        $titles = ['URL', 'Reachable', 'SSL Certificate', 'SSL Expiration date', 'SSL Issuer'];
44
45
        $this->output->table($titles, $rows);
46
    }
47
}