GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TranslationServiceProvider::boot()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.7333
c 0
b 0
f 0
cc 4
nc 3
nop 0
1
<?php
2
3
namespace Spatie\TranslationLoader;
4
5
use Illuminate\Support\Str;
6
use Illuminate\Translation\FileLoader;
7
use Illuminate\Translation\TranslationServiceProvider as IlluminateTranslationServiceProvider;
8
9
class TranslationServiceProvider extends IlluminateTranslationServiceProvider
10
{
11
    /**
12
     * Register the application services.
13
     */
14
    public function register()
15
    {
16
        parent::register();
17
18
        $this->mergeConfigFrom(__DIR__.'/../config/translation-loader.php', 'translation-loader');
19
    }
20
21
    /**
22
     * Bootstrap the application services.
23
     */
24
    public function boot()
25
    {
26
        if ($this->app->runningInConsole() && ! Str::contains($this->app->version(), 'Lumen')) {
27
            $this->publishes([
28
                __DIR__.'/../config/translation-loader.php' => config_path('translation-loader.php'),
29
            ], 'config');
30
31
            if (! class_exists('CreateLanguageLinesTable')) {
32
                $timestamp = date('Y_m_d_His', time());
33
34
                $this->publishes([
35
                    __DIR__.'/../database/migrations/create_language_lines_table.php.stub' => database_path('migrations/'.$timestamp.'_create_language_lines_table.php'),
36
                ], 'migrations');
37
            }
38
        }
39
    }
40
41
    /**
42
     * Register the translation line loader. This method registers a
43
     * `TranslationLoaderManager` instead of a simple `FileLoader` as the
44
     * applications `translation.loader` instance.
45
     */
46
    protected function registerLoader()
47
    {
48
        $this->app->singleton('translation.loader', function ($app) {
49
            $class = config('translation-loader.translation_manager');
50
51
            return new $class($app['files'], $app['path.lang']);
52
        });
53
    }
54
}
55