PhpTimeZoneServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 16
rs 10
wmc 3

2 Methods

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