Completed
Push — master ( cc3f25...fdac0f )
by Nicolas
02:44
created

LaravelVideoableServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 31
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A boot() 0 21 3
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