CacheReset::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * PWWEB\Localisation\Commands.
5
 *
6
 * Definition of the cache reset artisan command.
7
 *
8
 * @author    Frank Pillukeit <[email protected]>
9
 * @copyright 2020 pw-websolutions.com
10
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
11
 */
12
13
namespace PWWEB\Localisation\Commands;
14
15
use Illuminate\Console\Command;
16
use PWWEB\Localisation\LocalisationRegistrar;
17
18
class CacheReset extends Command
19
{
20
    /**
21
     * The console command name.
22
     *
23
     * @var string
24
     */
25
    protected $signature = 'pwweb:localisation:cache-reset';
26
27
    /**
28
     * The console command description.
29
     *
30
     * @var string
31
     */
32
    protected $description = 'Reset the localisation cache';
33
34
    /**
35
     * Execute the console command.
36
     *
37
     * @return void
38
     */
39
    public function handle()
40
    {
41
        if (true === app(LocalisationRegistrar::class)->forgetCachedLanguages()) {
42
            $this->info('Language cache flushed.');
43
        } else {
44
            $this->error('Unable to flush cache.');
45
        }
46
    }
47
}
48