Passed
Push — master ( 922b86...f4cc02 )
by Koen
02:28
created

TranslatableServiceProvider::boot()   A

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 0
Metric Value
eloc 3
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
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 6
    public function boot()
16
    {
17 6
        $this->publishes([
18 6
            __DIR__ . ' /../config/translatable.php' => config_path('translatable.php'),
19 6
        ], 'config');
20 6
    }
21
22
    /**
23
     * Registers the package's services.
24
     *
25
     * @return void
26
     */
27 6
    public function register()
28
    {
29
        $this->app->singleton(TranslationSavingService::class, function () {
30 6
            return new TranslationSavingService();
31 6
        });
32
33 6
        $this->mergeConfigFrom(__DIR__ . '/../config/translatable.php', 'translatable');
34 6
    }
35
}
36