NotificationsServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 17 3
A register() 0 4 1
1
<?php
2
3
namespace Appvise\AppStoreNotifications;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class NotificationsServiceProvider extends ServiceProvider
8
{
9
    public function boot()
10
    {
11
        if ($this->app->runningInConsole()) {
12
            $this->publishes([
13
                __DIR__.'/../config/appstore-server-notifications.php' => config_path('appstore-server-notifications.php'),
14
            ], 'config');
15
        }
16
17
        if (! class_exists('CreateAppleNotificationsTable')) {
18
            $timestamp = date('Y_m_d_His', time());
19
            $this->publishes([
20
                __DIR__.'/../database/migrations/create_apple_notifications_table.php.stub' => database_path("migrations/{$timestamp}_create_apple_notifications_table.php"),
21
            ], 'migrations');
22
        }
23
24
        $this->loadRoutesFrom(__DIR__.'/routes.php');
25
    }
26
27
    public function register()
28
    {
29
        $this->mergeConfigFrom(__DIR__.'/../config/appstore-server-notifications.php', 'appstore-server-notifications');
30
    }
31
}
32