ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 23
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 17
nc 3
nop 0
dl 0
loc 23
ccs 18
cts 18
cp 1
crap 3
rs 9.7
c 1
b 0
f 0
1
<?php
2
3
namespace IproSync;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7 3
    public function boot()
8
    {
9 3
        $this->loadTranslationsFrom(__DIR__.'/../lang', 'ipro-sync');
10
11 3
        if ($this->app->runningInConsole()) {
12 3
            if (IproSoftwareSync::$runsMigrations) {
13 3
                $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
14
            }
15 3
            $this->publishes([
16 3
                __DIR__.'/../config/iprosoftware-sync.php' => config_path('iprosoftware-sync.php'),
17 3
            ], 'config');
18
19
20 3
            $this->commands([
21 3
                \IproSync\Console\Commands\SettingsPullCommand::class,
22 3
                \IproSync\Console\Commands\ContactsPullCommand::class,
23 3
                \IproSync\Console\Commands\PropertiesPullCommand::class,
24 3
                \IproSync\Console\Commands\PropertiesCustomRatesPullCommand::class,
25 3
                \IproSync\Console\Commands\AvailabilityPullCommand::class,
26 3
                \IproSync\Console\Commands\BookingsPullCommand::class,
27 3
                \IproSync\Console\Commands\BlockoutsPullCommand::class,
28 3
                \IproSync\Console\Commands\RecentlyUpdatedBookingsBlockoutsPullCommand::class,
29 3
                \IproSync\Console\Commands\IproPullDatabaseCommand::class,
30 3
            ]);
31
        }
32
    }
33
34 3
    public function register()
35
    {
36 3
        $this->mergeConfigFrom(__DIR__.'/../config/iprosoftware-sync.php', 'iprosoftware-sync');
37
    }
38
}
39