Completed
Push — master ( c20595...fabc2c )
by Gregorio
01:25
created

ServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 36
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 1
A register() 0 10 1
1
<?php
2
3
namespace Gregoriohc\Moneta\Laravel;
4
5
use Gregoriohc\Moneta\Moneta;
6
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
7
8
class ServiceProvider extends BaseServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = false;
16
17
    /**
18
     * Bootstrap the application events.
19
     *
20
     * @return void
21
     */
22 3
    public function boot()
23
    {
24 3
        $configPath = $this->app->make('path.config');
25 3
        $this->publishes([__DIR__ . '/../../config/moneta.php' => $configPath . '/moneta.php']);
26 3
    }
27
28
    /**
29
     * Register the service provider.
30
     *
31
     * @return void
32
     */
33 3
    public function register()
34
    {
35 3
        $this->mergeConfigFrom(__DIR__ . '/../../config/moneta.php', 'moneta');
36
37 3
        $this->app['moneta'] = $this->app->share(function ($app) {
0 ignored issues
show
Bug introduced by
The method share() does not seem to exist on object<Illuminate\Contra...Foundation\Application>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
            // @codeCoverageIgnoreStart
39
            return new Moneta();
40
            // @codeCoverageIgnoreEnd
41 3
        });
42 3
    }
43
}
44