Passed
Push — master ( 040c30...9ca3f0 )
by Jorijn
03:22
created

ServiceProvider::getConfigPath()   A

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
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Jorijn\LaravelSecurityChecker;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7
    /**
8
     * Indicates if loading of the provider is deferred.
9
     *
10
     * @var bool
11
     */
12
    protected $defer = true;
13
14
    /**
15
     * Register the service provider.
16
     *
17
     * @return void
18
     */
19
    public function register()
20
    {
21
        $configPath = __DIR__ . '/../config/laravel-security-checker.php';
22
        $this->mergeConfigFrom($configPath, 'laravel-security-checker');
23
    }
24
25
    /**
26
     * Bootstrap the application events.
27
     *
28
     * @return void
29
     */
30
    public function boot()
31
    {
32
        $configPath = __DIR__ . '/../config/laravel-security-checker.php';
33
        $this->publishes([$configPath => $this->getConfigPath()], 'config');
34
    }
35
36
    /**
37
     * Get the config path
38
     *
39
     * @return string
40
     */
41
    protected function getConfigPath()
42
    {
43
        return config_path('laravel-security-checker.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

43
        return /** @scrutinizer ignore-call */ config_path('laravel-security-checker.php');
Loading history...
44
    }
45
46
    /**
47
     * Publish the config file
48
     *
49
     * @param  string $configPath
50
     */
51
    protected function publishConfig($configPath)
52
    {
53
        $this->publishes([$configPath => config_path('laravel-security-checker.php')], 'config');
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

53
        $this->publishes([$configPath => /** @scrutinizer ignore-call */ config_path('laravel-security-checker.php')], 'config');
Loading history...
54
    }
55
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
56