Passed
Push — master ( 8fee3b...a1623e )
by joery
02:09
created

DscanServiceProvider::registerHelpers()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Azak1r\Dscan;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class DscanServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->loadViewsFrom(__DIR__. '/resources/views', 'Dscan');
17
        $this->loadMigrationsFrom(__DIR__. '/Database/migrations');
18
19
        $this->publishes([
20
        __DIR__.'/resources/views' => resource_path('views/vendor/Dscan'),
0 ignored issues
show
Bug introduced by
The function resource_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

20
        __DIR__.'/resources/views' => /** @scrutinizer ignore-call */ resource_path('views/vendor/Dscan'),
Loading history...
21
    ], 'views');
22
23
        $this->publishes([
24
        __DIR__ . '/database/migrations' => $this->app->databasePath() . '/migrations'
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

24
        __DIR__ . '/database/migrations' => $this->app->/** @scrutinizer ignore-call */ databasePath() . '/migrations'

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...
25
    ], 'migrations');
26
27
        $this->publishes([
28
        __DIR__ . '/database/seeds' => $this->app->databasePath() . '/seeds'
29
    ], 'seeds');
30
31
        $this->registerHelpers();
32
        
33
    }
34
35
    /**
36
     * Register services.
37
     *
38
     * @return void
39
     */
40
    public function register()
41
    {
42
        include __DIR__. '/routes/web.php';
43
        $this->app->make('Azak1r\Dscan\Http\Controllers\DscanController');
44
    }
45
46
    public function registerHelpers()
47
{
48
    // Load the helpers in app/Http/helpers.php
49
    if (file_exists($file = app_path('Http/helpers.php')))
0 ignored issues
show
Bug introduced by
The function app_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

49
    if (file_exists($file = /** @scrutinizer ignore-call */ app_path('Http/helpers.php')))
Loading history...
50
    {
51
        require $file;
52
    }
53
}
54
}
55