Completed
Pull Request — master (#447)
by Alexandru
01:47
created

FlushCollectedStatistics   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 1
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