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 ( 7eca44...e8b188 )
by Freek
02:30
created

SiteRepository::getAllForSslCheck()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace Spatie\UptimeMonitor;
4
5
use Illuminate\Support\Collection;
6
use Spatie\UptimeMonitor\Models\Enums\SslCertificateStatus;
7
use Spatie\UptimeMonitor\Models\Enums\UptimeStatus;
8
use Spatie\UptimeMonitor\Models\Site;
9
10
class SiteRepository
11
{
12
    public static function getAllEnabledSites(): Collection
13
    {
14
        return Site::enabled()
15
            ->get()
16
            ->sortByHost();
17
    }
18
19
    public static function getAllForUptimeCheck(): SiteCollection
20
    {
21
        $sites = Site::enabled()
22
            ->get()
23
            ->filter(function (Site $site) {
24
                return $site->shouldCheckUptime();
25
            })
26
            ->sortByHost();
27
28
        return new SiteCollection($sites);
29
    }
30
31
    public static function getAllForSslCheck(): Collection
32
    {
33
        return Site::enabled()
34
            ->where('check_ssl_certificate', true)
35
            ->get()
36
            ->sortByHost();
37
    }
38
39
    public static function healthySites(): Collection
40
    {
41
        return Site::enabled()
42
            ->get()
43
            ->filter(function (Site $site) {
44
                return $site->isHealthy();
45
            })
46
        ->sortByHost();
47
48
    }
49
50
    public static function downSites()
51
    {
52
        return Site::enabled()
53
            ->where('uptime_status', UptimeStatus::DOWN)
54
            ->get()
55
            ->sortByHost();;
56
    }
57
58
    public static function withSslProblems()
59
    {
60
        return Site::enabled()
61
            ->where('check_ssl_certificate', true)
62
            ->where('ssl_certificate_status', SslCertificateStatus::INVALID)
63
            ->get()
64
            ->sortByHost();;
65
    }
66
67
    public static function unhealthySites(): Collection
68
    {
69
        return Site::enabled()
70
            ->get()
71
            ->reject(function (Site $site) {
72
                return $site->isHealthy();
73
            })
74
            ->sortByHost();
75
    }
76
77
    public static function uncheckedSites()
78
    {
79
        return Site::enabled()
80
            ->where('uptime_status', UptimeStatus::NOT_YET_CHECKED)
81
            ->get()
82
            ->sortByHost();
83
    }
84
}
85