IndexNowServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 29
ccs 10
cts 10
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A configurePackage() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\LaravelIndexNow;
6
7
use LaravelFreelancerNL\LaravelIndexNow\Commands\GenerateKeyCommand;
8
use Spatie\LaravelPackageTools\Exceptions\InvalidPackage;
9
use Spatie\LaravelPackageTools\Package;
10
use Spatie\LaravelPackageTools\PackageServiceProvider;
11
12
class IndexNowServiceProvider extends PackageServiceProvider
13
{
14 16
    public function configurePackage(Package $package): void
15
    {
16
        /*
17
         * This class is a Package Service Provider
18
         *
19
         * More info: https://github.com/spatie/laravel-package-tools
20
         */
21 16
        $package
22 16
            ->name('index-now')
23 16
            ->hasConfigFile('index-now')
24 16
            ->hasCommand(GenerateKeyCommand::class);
25
    }
26
27
    /**
28
     * Register any application services.
29
     *
30
     * @return void
31
     *
32
     * @throws InvalidPackage
33
     */
34 16
    public function register()
35
    {
36 16
        parent::register();
37
38 16
        $this->app->bind(
39 16
            'index-now',
40 16
            'LaravelFreelancerNL\LaravelIndexNow\IndexNow',
41 16
        );
42
    }
43
}
44