ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
eloc 7
c 2
b 1
f 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A boot() 0 4 1
1
<?php
2
3
namespace Fomvasss\LaravelStrTokens;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7
    protected $defer = false;
8
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->publishes([__DIR__.'/../config/str-tokens.php' => config_path('str-tokens.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

16
        $this->publishes([__DIR__.'/../config/str-tokens.php' => /** @scrutinizer ignore-call */ config_path('str-tokens.php')
Loading history...
17
        ], 'str-tokens-config');
18
    }
19
20
    /**
21
     * Register the application services.
22
     *
23
     * @return void
24
     */
25
    public function register()
26
    {
27
        $this->mergeConfigFrom(__DIR__.'/../config/str-tokens.php', 'str-tokens');
28
29
        $this->app->singleton(StrTokenGenerator::class, function () {
30
            return new StrTokenGenerator($this->app);
31
        });
32
    }
33
}
34