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 ( 409123...1f0c23 )
by Freek
02:30 queued 49s
created

SitesWithSslProblems::display()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 23
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 12
nc 2
nop 0
dl 0
loc 23
rs 9.0856
c 0
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->info('Sites with ssl problems');
27
        $this->output->info('=======================');
28
29
        $rows = $sitesWithSslProblems->map(function (Site $site) {
30
            $url = $site->url;
31
32
            $reason = $site->ssl_certificate_failure_reason;
33
34
            return compact('url', 'reason');
35
        });
36
37
        $titles = ['URL', 'Problem description'];
38
39
        $this->output->table($titles, $rows);
40
    }
41
}
42