LaravelVideoableServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 21
ccs 15
cts 15
cp 1
crap 3
rs 9.584
c 0
b 0
f 0
1
<?php
2
3
namespace Nwidart\LaravelVideoable;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class LaravelVideoableServiceProvider extends ServiceProvider
8
{
9 8
    public function register()
10
    {
11 8
        $this->mergeConfigFrom(
12 8
            __DIR__.'/../config/laravel-videoable.php', 'laravel-videoable'
13
        );
14 8
    }
15
16 8
    public function boot()
17
    {
18 8
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laravel-videoable');
19
20 8
        if ($this->app->runningInConsole()) {
21 8
            if (! class_exists('CreateVideosTable')) {
22 1
                $timestamp = date('Y_m_d_His', time());
23 1
                $this->publishes([
24 1
                    __DIR__ . '/../database/migrations/create_video_table.php.stub' => $this->app->databasePath() . '/migrations/' . $timestamp . '_create_videos_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()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
25 1
                ], 'migrations');
26
            }
27
28 8
            $this->publishes([
29 8
                __DIR__.'/../config/laravel-videoable.php' => config_path('laravel-videoable.php'),
30 8
            ], 'config');
31
32 8
            $this->publishes([
33 8
                __DIR__ . '/../resources/views' => base_path('resources/views/vendor/laravel-videoable'),
34 8
            ], 'views');
35
        }
36 8
    }
37
}
38