TrimCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
1
<?php
2
3
namespace Insense\LaravelTelescopePruning\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Contracts\Foundation\Application;
7
use Insense\LaravelTelescopePruning\PruneEntries;
8
use Laravel\Telescope\Telescope;
9
10
class TrimCommand extends Command
11
{
12
    /**
13
     * The name and signature of the console command.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'telescope:trim';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Trim entries from the Telescope database';
25
26
    /**
27
     * Execute the console command.
28
     *
29
     * @param  Illuminate\Contracts\Foundation\Application  $app
0 ignored issues
show
Bug introduced by
The type Insense\LaravelTelescope...\Foundation\Application was not found. Did you mean Illuminate\Contracts\Foundation\Application? If so, make sure to prefix the type with \.
Loading history...
30
     * @return void
31
     */
32
    public function handle(Application $app)
33
    {
34
        Telescope::withoutRecording(function () use($app) {
35
            $numTrimmed = (new PruneEntries($app))->prune();
36
37
            $this->info($numTrimmed . ' entries trimmed.');
38
        });
39
    }
40
}
41
42