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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 42
rs 10
c 1
b 0
f 0
wmc 4
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAllForUptimeCheck() 0 11 1
A getAllForSslCheck() 0 7 1
A healthySites() 0 9 1
A unhealthySites() 0 9 1
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