ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/laravel-number-to-words
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace PHPViet\Laravel\NumberToWords;
10
11
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
12
use PHPViet\NumberToWords\Dictionary;
13
use PHPViet\NumberToWords\DictionaryInterface;
14
use PHPViet\NumberToWords\SouthDictionary;
15
16
/**
17
 * @author Vuong Minh <[email protected]>
18
 * @since 1.0.0
19
 */
20
class ServiceProvider extends BaseServiceProvider
21
{
22
    public $bindings = [
23
        'n2w' => Transformer::class,
24
    ];
25
26
    public $singletons = [
27
        Dictionary::class => Dictionary::class,
28
        DictionaryInterface::class => Dictionary::class,
29
        SouthDictionary::class => SouthDictionary::class,
30
    ];
31
32
    public function boot(): void
33
    {
34
        $this->publishes([
35
            __DIR__.'/../config/n2w.php' => config_path('n2w.php'),
36
        ], 'config');
37
    }
38
39
    public function register(): void
40
    {
41
        $this->mergeConfigFrom(__DIR__.'/../config/n2w.php', 'n2w');
42
    }
43
}
44