Completed
Push — develop ( 2e70dd...943c47 )
by Abdelrahman
16:44
created

BookingsServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 2
cbo 2
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A boot() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Bookings\Providers;
6
7
use Illuminate\Support\ServiceProvider;
8
use Rinvex\Support\Traits\ConsoleTools;
9
use Rinvex\Bookings\Console\Commands\MigrateCommand;
10
use Rinvex\Bookings\Console\Commands\PublishCommand;
11
use Rinvex\Bookings\Console\Commands\RollbackCommand;
12
13
class BookingsServiceProvider extends ServiceProvider
14
{
15
    use ConsoleTools;
16
17
    /**
18
     * The commands to be registered.
19
     *
20
     * @var array
21
     */
22
    protected $commands = [
23
        MigrateCommand::class => 'command.rinvex.bookings.migrate',
24
        PublishCommand::class => 'command.rinvex.bookings.publish',
25
        RollbackCommand::class => 'command.rinvex.bookings.rollback',
26
    ];
27
28
    /**
29
     * Register the application services.
30
     *
31
     * @return void
32
     */
33
    public function register(): void
34
    {
35
        $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.bookings');
36
37
        // Register console commands
38
        $this->registerCommands($this->commands);
39
    }
40
41
    /**
42
     * Bootstrap the application services.
43
     *
44
     * @return void
45
     */
46
    public function boot(): void
47
    {
48
        // Publish Resources
49
        $this->publishesConfig('rinvex/laravel-bookings');
50
        $this->publishesMigrations('rinvex/laravel-bookings');
51
        ! $this->autoloadMigrations('rinvex/laravel-bookings') || $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
52
    }
53
}
54