ServiceProvider::publishConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Ka4ivan\ViewSortable;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7
    /**
8
     * Bootstrap the application services.
9
     *
10
     * @return void
11
     */
12
    public function boot()
13
    {
14
        $this->publishConfig();
15
    }
16
17
    /**
18
     * Register the application services.
19
     *
20
     * @return void
21
     */
22
    public function register()
23
    {
24
        $this->mergeConfigFrom(__DIR__.'/../config/view-sortable.php', 'view-sortable');
25
26
        $this->app->bind(\Ka4ivan\ViewSortable\Sort::class, function () {
0 ignored issues
show
Bug introduced by
The type Ka4ivan\ViewSortable\Sort 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...
27
            return new \Ka4ivan\ViewSortable\Support\Sort;
28
        });
29
30
        $loader = \Illuminate\Foundation\AliasLoader::getInstance();
0 ignored issues
show
Bug introduced by
The type Illuminate\Foundation\AliasLoader 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...
31
        $loader->alias('Sort', "Ka4ivan\\ViewSortable\\Facades\\Sort");
32
    }
33
34
    protected function publishConfig()
35
    {
36
        $this->publishes([
37
            __DIR__ . '/../config/view-sortable.php' => config_path('view-sortable.php'),
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

37
            __DIR__ . '/../config/view-sortable.php' => /** @scrutinizer ignore-call */ config_path('view-sortable.php'),
Loading history...
38
        ], 'view-sortable');
39
    }
40
}
41