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.

GenerateSitemap::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace ProtoneMedia\LaravelMixins\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Artisan;
7
use Spatie\Sitemap\SitemapGenerator;
8
9
class GenerateSitemap extends Command
10
{
11
    /**
12
     * The console command name.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'sitemap:generate';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Generate the sitemap.';
24
25
    /**
26
     * Set the signature.
27
     *
28
     * @param string $signature
29
     */
30
    public function __construct(string $signature = 'sitemap:generate')
31
    {
32
        $this->signature = $signature;
33
34
        parent::__construct();
35
    }
36
37
    /**
38
     * Execute the console command.
39
     *
40
     * @return mixed
41
     */
42
    public function handle(SitemapGenerator $sitemapGenerator)
43
    {
44
        $sitemapGenerator
45
            ->setUrl(config('app.url'))
46
            ->writeToFile(public_path('sitemap.xml'));
47
    }
48
49
    /**
50
     * Register the command.
51
     *
52
     * @return void
53
     */
54
    public static function register(string $signature = 'sitemap:generate')
55
    {
56
        Artisan::registerCommand(new static($signature));
57
    }
58
}
59