Completed
Pull Request — master (#447)
by Marcel
02:47 queued 01:22
created

FlushCollectedStatistics::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Console\Commands;
4
5
use BeyondCode\LaravelWebSockets\Facades\StatisticsCollector;
6
use Illuminate\Console\Command;
7
8
class FlushCollectedStatistics extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'websockets:flush';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string|null
21
     */
22
    protected $description = 'Flush the collected statistics.';
23
24
    /**
25
     * Run the command.
26
     *
27
     * @return void
28
     */
29
    public function handle()
30
    {
31
        $this->comment('Flushing the collected WebSocket Statistics...');
32
33
        StatisticsCollector::flush();
34
35
        $this->line('Flush complete!');
36
    }
37
}
38