RateableServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 2
A register() 0 8 1
1
<?php
2
3
namespace Yoeunes\Rateable;
4
5
use Yoeunes\Rateable\Services\Raty;
6
use Illuminate\Support\ServiceProvider;
7
8
class RateableServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application events.
12
     */
13
    public function boot()
14
    {
15
        $this->publishes([
16
            __DIR__.'/../config/rateable.php' => config_path('rateable.php'),
17
        ], 'config');
18
19
        if (! class_exists('CreateRatingsTable')) {
20
            $this->publishes([
21
                __DIR__.'/../migrations/create_ratings_table.php' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_ratings_table.php'),
22
            ], 'migrations');
23
        }
24
    }
25
26
    /**
27
     * Register the service provider.
28
     */
29
    public function register()
30
    {
31
        $this->mergeConfigFrom(__DIR__.'/../config/rateable.php', 'rateable');
32
33
        $this->app->bind('raty', function () {
34
            return new Raty();
35
        });
36
    }
37
}
38