PhpTimeZoneServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 2
b 0
f 0
nc 2
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Joy2362\PhpTimezone;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class PhpTimeZoneServiceProvider extends ServiceProvider
8
{
9
    public function boot()
10
    {
11
        if ($this->app->runningInConsole()) {
12
            $this->publishes([
13
                __DIR__.'/./config/config.php' => $this->app->configPath('Timezone.php')
14
            ], 'config');
15
        }
16
    }
17
18
    public function register()
19
    {
20
        $this->mergeConfigFrom(__DIR__.'/config/config.php', 'Timezone');
21
        $this->app->bind('TimeZoneService', function () {
22
            return new TimeZoneService();
23
        });
24
    }
25
}
26