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 ( 0a8ad6...ac3b98 )
by Freek
02:19
created

CheckUptimeMonitors   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 31
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 14 1
1
<?php
2
3
namespace Spatie\UptimeMonitor\Commands;
4
5
use Illuminate\Console\Command;
6
use Spatie\UptimeMonitor\Models\UptimeMonitor;
7
use Spatie\UptimeMonitor\Services\PingMonitors\UptimeMonitorCollection;
8
9
class CheckUptimeMonitors extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'uptime-monitor:check';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Check all uptime monitors';
24
25
    public function handle()
26
    {
27
        $uptimeMonitors = UptimeMonitor::all()->filter(function (UptimeMonitor $uptimeMonitor) {
28
            return $uptimeMonitor->shouldCheck();
29
        });
30
31
        $this->comment('Need to check '.count($uptimeMonitors).' sites...');
32
33
        $uptimeMonitorCollection = new UptimeMonitorCollection($uptimeMonitors);
34
35
        $uptimeMonitorCollection->check();
36
37
        $this->info('All done!');
38
    }
39
}
40