publishConfigurationFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
namespace Reedware\LaravelBlueprints;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class BlueprintsServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Indicates if loading of the provider is deferred.
11
     *
12
     * @var bool
13
     */
14
    protected $defer = true;
15
16
    /**
17
     * Register the service provider.
18
     *
19
     * @return void
20
     */
21
    public function register()
22
    {
23
        //
24
    }
25
26
    /**
27
     * Bootstrap the application events.
28
     *
29
     * @return void
30
     */
31
    public function boot()
32
    {
33
        // Publish the Configuration File
34
        $this->publishConfigurationFile();
35
    }
36
37
    /**
38
     * Publishes the Configuration File.
39
     *
40
     * @return void
41
     */
42
    protected function publishConfigurationFile()
43
    {
44
        // Determine the Local Configuration Path
45
        $source = $this->getLocalConfigurationPath();
46
47
        // Determine the Application Configuration Path
48
        $destination = $this->getApplicationConfigPath();
49
50
        // Publish the Configuration File
51
        $this->publishes([$source => $destination], 'config');
52
    }
53
54
    /**
55
     * Returns the Path to the Configuration File within this Package.
56
     *
57
     * @return string
58
     */
59
    protected function getLocalConfigurationPath()
60
    {
61
        return __DIR__ . '/../config/blueprints.php';
62
    }
63
64
    /**
65
     * Returns the Path to the Configuration File within the Application.
66
     *
67
     * @return string
68
     */
69
    protected function getApplicationConfigPath()
70
    {
71
        return config_path('blueprints.php');
0 ignored issues
show
Bug introduced by
The function config_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

71
        return /** @scrutinizer ignore-call */ config_path('blueprints.php');
Loading history...
72
    }
73
74
    /**
75
     * Get the services provided by the provider.
76
     *
77
     * @return array
78
     */
79
    public function provides()
80
    {
81
        return [
82
            //
83
        ];
84
    }
85
}
86