ServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 13
c 0
b 0
f 0
dl 0
loc 37
ccs 0
cts 18
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 2 1
A boot() 0 7 1
A routes() 0 15 2
1
<?php
2
3
namespace NovaIprosoftwareApi;
4
5
use Illuminate\Support\Facades\Route;
6
use Laravel\Nova\Events\ServingNova;
7
use Laravel\Nova\Http\Middleware\Authenticate;
8
use Laravel\Nova\Nova;
9
use NovaIprosoftwareApi\Http\Middleware\Authorize;
10
11
class ServiceProvider extends \Illuminate\Support\ServiceProvider
12
{
13
    public function boot()
14
    {
15
        $this->app->booted(function () {
16
            $this->routes();
17
        });
18
19
        Nova::serving(function (ServingNova $event) {
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed. ( Ignorable by Annotation )

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

19
        Nova::serving(function (/** @scrutinizer ignore-unused */ ServingNova $event) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
            //
21
        });
22
    }
23
24
    protected function routes()
25
    {
26
        if ($this->app->routesAreCached()) {
27
            return;
28
        }
29
30
        Nova::router(
31
            ['nova', Authenticate::class, Authorize::class],
32
            'iprosoftware-api'
33
        )
34
            ->group(__DIR__.'/../routes/inertia.php');
35
36
        Route::middleware(['nova', Authorize::class])
0 ignored issues
show
Bug introduced by
The method middleware() does not exist on Illuminate\Support\Facades\Route. ( Ignorable by Annotation )

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

36
        Route::/** @scrutinizer ignore-call */ 
37
               middleware(['nova', Authorize::class])

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
             ->prefix('nova-vendor/iprosoftware-api')
38
             ->group(__DIR__.'/../routes/api.php');
39
    }
40
41
    /**
42
     * Register any application services.
43
     *
44
     * @return void
45
     */
46
    public function register()
47
    {
48
        //
49
    }
50
}
51