TranslatableServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
ccs 4
cts 4
cp 1
cc 1
nc 1
nop 0
crap 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