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.

FlushVarnishCache   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 28
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
namespace Spatie\Varnish\Commands;
4
5
use Illuminate\Console\Command;
6
use Spatie\Varnish\Varnish;
7
8
class FlushVarnishCache extends Command
9
{
10
    /**
11
     * The console command name.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'varnish:flush {url?}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Flush the varnish cache. Optionally you can provide a regex of an url you want to flush, e.g. /nl/*.';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return mixed
28
     */
29
    public function handle()
30
    {
31
        $url = $this->argument('url');
32
33
        (new Varnish())->flush(null, $url);
0 ignored issues
show
Bug introduced by
It seems like $url can also be of type string[]; however, parameter $url of Spatie\Varnish\Varnish::flush() does only seem to accept null|string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

33
        (new Varnish())->flush(null, /** @scrutinizer ignore-type */ $url);
Loading history...
34
35
        $this->comment('The varnish cache has been flushed!');
36
    }
37
}
38