Completed
Push — master ( f05ffa...605762 )
by Vasyl
117:24 queued 115:51
created

SlugMakerServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 2
A register() 0 5 1
1
<?php
2
3
namespace Fomvasss\SlugMaker;
4
5
use Illuminate\Support\ServiceProvider;
6
use Illuminate\View\Compilers\BladeCompiler;
0 ignored issues
show
Bug introduced by
The type Illuminate\View\Compilers\BladeCompiler was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class SlugMakerServiceProvider extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        $this->publishes([
13
            __DIR__.'/../config/slugmaker.php' => $this->app->configPath().'/slugmaker.php',
0 ignored issues
show
Bug introduced by
The method configPath() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

13
            __DIR__.'/../config/slugmaker.php' => $this->app->/** @scrutinizer ignore-call */ configPath().'/slugmaker.php',

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...
14
        ], 'config');
15
16
        if (! class_exists('CreateSlugsTable')) {
17
            $timestamp = date('Y_m_d_His', time());
18
19
            $this->publishes([
20
                __DIR__.'/../database/migrations/create_slugs_table.php.stub' => $this->app->databasePath()."/migrations/{$timestamp}_create_slugs_table.php",
0 ignored issues
show
Bug introduced by
The method databasePath() does not exist on Illuminate\Contracts\Foundation\Application. Did you maybe mean basePath()? ( Ignorable by Annotation )

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

20
                __DIR__.'/../database/migrations/create_slugs_table.php.stub' => $this->app->/** @scrutinizer ignore-call */ databasePath()."/migrations/{$timestamp}_create_slugs_table.php",

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...
21
            ], 'migrations');
22
        }
23
24
        // if ($this->app->runningInConsole()) {
25
        //     $this->commands([
26
        //         Commands\MigrateSlugMaker::class,
27
        //     ]);
28
        // }
29
30
    }
31
32
    public function register()
33
    {
34
        $this->mergeConfigFrom(
35
            __DIR__.'/../config/slugmaker.php',
36
            'slugmaker'
37
        );
38
    }
39
40
}
41