TranslationServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 22
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerLoader() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\LaravelLang\Providers;
6
7
use Arcanedev\LaravelLang\FileLoader;
8
use Illuminate\Foundation\Application;
9
use Illuminate\Translation\TranslationServiceProvider as ServiceProvider;
10
11
/**
12
 * Class     TranslationServiceProvider
13
 *
14
 * @author   ARCANEDEV <[email protected]>
15
 */
16
class TranslationServiceProvider extends ServiceProvider
17
{
18
    /* -----------------------------------------------------------------
19
     |  Main Methods
20
     | -----------------------------------------------------------------
21
     */
22
23
    /**
24
     * Register the translation line loader.
25
     */
26 174
    protected function registerLoader(): void
27
    {
28 174
        $this->app->singleton('translation.loader', function(Application $app) {
29 66
            return new FileLoader(
30 66
                $app['files'],
31 66
                $app->langPath(),
32 66
                $app['config']->get('laravel-lang.vendor', []),
33 66
                $app['config']->get('laravel-lang.locales', [])
34
            );
35 174
        });
36 174
    }
37
}
38