Passed
Push — master ( f11ec2...6183f9 )
by Miks
07:03
created

RouteClearCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Arbory\Base\Console\Commands;
4
5
use Arbory\Base\Services\NodeRoutesCache;
6
use Illuminate\Console\Command;
7
use Illuminate\Filesystem\Filesystem;
8
use Illuminate\Foundation\Console\RouteClearCommand as LaravelRouteClearCommand;
9
10
11
class RouteClearCommand extends LaravelRouteClearCommand
12
{
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'arbory:route:clear';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Remove the route cache file and timestamp';
26
27
28
    public function handle()
29
    {
30
        $this->files->delete(NodeRoutesCache::getCachedRoutesPath());
31
        $this->files->delete(NodeRoutesCache::getCachedRoutesTimestampPath());
32
        $this->components->info('Route cache cleared successfully.');
33
    }
34
}
35