JanitorServiceProvider::provides()   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 Signifly\Janitor;
4
5
use Illuminate\Contracts\Support\DeferrableProvider;
6
use Illuminate\Support\ServiceProvider;
7
use Signifly\Janitor\Contracts\Factory;
8
9
class JanitorServiceProvider extends ServiceProvider implements DeferrableProvider
10
{
11
    public function boot()
12
    {
13
        if ($this->app->runningInConsole()) {
14
            $this->publishes([
15
                __DIR__.'/../config/janitor.php' => config_path('janitor.php'),
16
            ], 'janitor-config');
17
        }
18
19
        $this->mergeConfigFrom(__DIR__.'/../config/janitor.php', 'janitor');
20
    }
21
22
    /**
23
     * Register the service provider.
24
     *
25
     * @return void
26
     */
27
    public function register()
28
    {
29
        $this->app->singleton(Factory::class, function ($app) {
30
            return new JanitorManager($app);
31
        });
32
    }
33
34
    /**
35
     * Get the services provided by the provider.
36
     *
37
     * @return array
38
     */
39
    public function provides()
40
    {
41
        return [Factory::class];
42
    }
43
}
44