CloudMessageServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigFile() 0 3 1
A boot() 0 6 1
A register() 0 4 1
1
<?php
2
3
namespace MedianetDev\CloudMessage;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class CloudMessageServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        // if ($this->app->runningInConsole() && function_exists('config_path')) {  // function not available and 'publish' not relevant in Lumen
15
        $this->publishes([
16
            $this->getConfigFile() => config_path('cloud_message.php'),
17
        ], 'config');
18
19
        // }
20
    }
21
22
    /**
23
     * Register the application services.
24
     */
25
    public function register()
26
    {
27
        // Automatically apply the package configuration
28
        $this->mergeConfigFrom($this->getConfigFile(), 'cloud_message');
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    protected function getConfigFile(): string
35
    {
36
        return __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'cloud_message.php';
37
    }
38
}
39