YandexSpellerServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Fecony\YandexSpeller\Providers;
4
5
use Fecony\YandexSpeller\YandexSpeller;
6
use Illuminate\Support\ServiceProvider;
7
8
class YandexSpellerServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15
    public function boot(): void
16
    {
17
        $this->publishes([
18
            __DIR__.'/../../config/yandex-speller.php' => config_path('yandex-speller.php'),
19
        ], 'yandex-speller');
20
    }
21
22
    /**
23
     * Register the application services.
24
     *
25
     * @return void
26
     */
27
    public function register(): void
28
    {
29
        $this->mergeConfigFrom(
30
            __DIR__.'/../../config/yandex-speller.php', 'yandex-speller'
31
        );
32
33
        $this->app->singleton('yandex-speller', function () {
34
            return new YandexSpeller();
35
        });
36
37
        $this->app->bind(YandexSpeller::class, function () {
38
            return new YandexSpeller();
39
        });
40
    }
41
}
42