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.

RouteTranslationsClearCommand   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 4
dl 0
loc 62
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 19 4
1
<?php
2
3
namespace Mcamara\LaravelLocalization\Commands;
4
5
use Mcamara\LaravelLocalization\Traits\TranslatedRouteCommandContext;
6
use Illuminate\Console\Command;
7
use Illuminate\Filesystem\Filesystem;
8
9
class RouteTranslationsClearCommand extends Command
10
{
11
    use TranslatedRouteCommandContext;
12
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'route:trans:clear';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Remove the translated route cache files for each locale';
26
27
    /**
28
     * The filesystem instance.
29
     *
30
     * @var \Illuminate\Filesystem\Filesystem
31
     */
32
    protected $files;
33
34
    /**
35
     * Create a new route clear command instance.
36
     *
37
     * @param  \Illuminate\Filesystem\Filesystem  $files
38
     */
39
    public function __construct(Filesystem $files)
40
    {
41
        parent::__construct();
42
43
        $this->files = $files;
44
    }
45
46
    /**
47
     * Execute the console command.
48
     *
49
     * @return void
50
     */
51
    public function handle()
52
    {
53
        foreach ($this->getSupportedLocales() as $locale) {
54
55
            $path = $this->makeLocaleRoutesPath($locale);
56
57
            if ($this->files->exists($path)) {
58
                $this->files->delete($path);
59
            }
60
        }
61
62
        $path = $this->laravel->getCachedRoutesPath();
63
64
        if ($this->files->exists($path)) {
65
            $this->files->delete($path);
66
        }
67
68
        $this->info('Route caches for locales cleared!');
69
    }
70
}
71