ServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 35
ccs 12
cts 14
cp 0.8571
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A boot() 0 16 3
1
<?php
2
3
namespace ThinkOne\NovaFlexibleContentFieldShortcode;
4
5
use Laravel\Nova\Events\ServingNova;
6
use Laravel\Nova\Nova;
7
8
class ServiceProvider extends \Illuminate\Support\ServiceProvider
9
{
10
    /**
11
     * Bootstrap any application services.
12
     *
13
     * @return void
14
     */
15 11
    public function boot()
16
    {
17 11
        if ($this->app->runningInConsole()) {
18 11
            $this->publishes([
19 11
                __DIR__ . '/../config/nfc-shortcode.php' => config_path('nfc-shortcode.php'),
20 11
            ], 'config');
21
22
23 11
            $this->commands([
24 11
            ]);
25
        }
26
        /** @psalm-suppress UndefinedClass **/
27 11
        if (class_exists(Nova::class)) {
28 11
            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

28
            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...
29
                Nova::script('nova-flexible-content-field-shortcode', __DIR__ . '/../dist/js/field.js');
30
                Nova::style('nova-flexible-content-field-shortcode', __DIR__ . '/../dist/css/field.css');
31 11
            });
32
        }
33
    }
34
35
    /**
36
     * Register any application services.
37
     *
38
     * @return void
39
     */
40 11
    public function register()
41
    {
42 11
        $this->mergeConfigFrom(__DIR__ . '/../config/nfc-shortcode.php', 'nfc-shortcode');
43
    }
44
}
45