CloudMessageServiceProvider::getConfigFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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