TranslationServiceProvider::registerLoader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 9
cts 9
cp 1
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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