TranslatableServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A boot() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace KoenHoeijmakers\LaravelTranslatable;
4
5
use Illuminate\Support\ServiceProvider;
6
use KoenHoeijmakers\LaravelTranslatable\Services\TranslationSavingService;
7
8
class TranslatableServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Boots the service provider.
12
     *
13
     * @return void
14
     */
15 34
    public function boot()
16
    {
17 34
        $this->publishes([
18 34
            __DIR__ . ' /../config/translatable.php' => config_path('translatable.php'),
19 34
        ], 'config');
20 34
    }
21
22
    /**
23
     * Registers the package's services.
24
     *
25
     * @return void
26
     */
27 34
    public function register()
28
    {
29
        $this->app->singleton(TranslationSavingService::class, function () {
30 24
            return new TranslationSavingService();
31 34
        });
32
33 34
        $this->mergeConfigFrom(__DIR__ . '/../config/translatable.php', 'translatable');
34 34
    }
35
}
36