ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 3
eloc 9
c 5
b 0
f 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 11 1
A boot() 0 5 2
1
<?php
2
3
namespace Gurgentil\LaravelStorable;
4
5
use Gurgentil\LaravelStorable\Console\Commands\MakeStorableCommand;
6
use Gurgentil\LaravelStorable\Services\DeleteStorableFile;
7
use Gurgentil\LaravelStorable\Services\GenerateStorableFile;
8
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
9
10
class ServiceProvider extends IlluminateServiceProvider
11
{
12
    /**
13
     * Register the application services.
14
     */
15
    public function register(): void
16
    {
17
        $this->app->bind('delete-storable-file', static function () {
18
            return new DeleteStorableFile;
19
        });
20
21
        $this->app->bind('generate-storable-file', static function () {
22
            return new GenerateStorableFile;
23
        });
24
25
        $this->mergeConfigFrom(__DIR__ . '/../config/storable.php', 'storable');
26
    }
27
28
    /**
29
     * Bootstrap the application services.
30
     */
31
    public function boot(): void
32
    {
33
        if ($this->app->runningInConsole()) {
34
            $this->commands([
35
                MakeStorableCommand::class,
36
            ]);
37
        }
38
    }
39
}
40