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
Pull Request — master (#17)
by Freek
111:15 queued 61:06
created

SiteRepository::unhealthySites()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 9
rs 9.6666
c 1
b 0
f 0
1
<?php
2
3
namespace Spatie\UptimeMonitor;
4
5
use Illuminate\Support\Collection;
6
use Spatie\UptimeMonitor\Models\Site;
7
use Spatie\UptimeMonitor\Services\PingMonitors\SiteCollection;
8
9
class SiteRepository
10
{
11
    public static function getAllForUptimeCheck(): SiteCollection
12
    {
13
        $sites = Site::enabled()
14
            ->orderBy('url')
15
            ->get()
16
            ->filter(function (Site $site) {
17
                return $site->shouldCheckUptime();
18
            });
19
20
        return new SiteCollection($sites);
21
    }
22
23
    public static function getAllForSslCheck(): Collection
24
    {
25
        return Site::enabled()
26
            ->orderBy('url')
27
            ->where('check_ssl_certificate', true)
28
            ->get();
29
    }
30
31
    public static function healthySites(): Collection
32
    {
33
        return Site::enabled()
34
            ->orderBy('url')
35
            ->get()
36
            ->filter(function (Site $site) {
37
                return $site->isHealthy();
38
            });
39
    }
40
41
    public function unhealthySites(): Collection
42
    {
43
        return Site::enabled()
44
            ->orderBy('url')
45
            ->get()
46
            ->reject(function (Site $site) {
47
                return $site->isHealthy();
48
            });
49
    }
50
}
51