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 ( 96c940...614aca )
by Freek
01:50
created

SitesWithSslProblems::display()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 24
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 13
nc 2
nop 0
dl 0
loc 24
rs 8.9713
c 1
b 0
f 0
1
<?php
2
3
namespace Spatie\UptimeMonitor\Commands\SiteLists;
4
5
use Illuminate\Console\Command;
6
use Spatie\UptimeMonitor\Models\Site;
7
use Spatie\UptimeMonitor\SiteRepository;
8
9
class SitesWithSslProblems
10
{
11
    protected $output;
12
13
    public function __construct(Command $output)
14
    {
15
        $this->output = $output;
16
    }
17
18
    public function display()
19
    {
20
        $sitesWithSslProblems = SiteRepository::withSslProblems();
21
22
        if (! $sitesWithSslProblems->count()) {
23
            return;
24
        }
25
26
        $this->output->warn('Sites with ssl problems');
27
        $this->output->warn('=======================');
28
29
        $rows = $sitesWithSslProblems->map(function (Site $site) {
30
            $url = $site->url;
31
32
            $reason = $site->chunkedLastSslFailureReason;
33
34
            return compact('url', 'reason');
35
        });
36
37
        $titles = ['URL', 'Problem description'];
38
39
        $this->output->table($titles, $rows);
40
        $this->output->line('');
41
    }
42
}
43