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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A handle() 0 5 1
A __construct() 0 5 1
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