Completed
Pull Request — master (#284)
by Alexandru
01:20
created

RestartWebSocketServer::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Cache;
7
use Illuminate\Support\InteractsWithTime;
8
9
class RestartWebSocketServer extends Command
10
{
11
    use InteractsWithTime;
12
13
    /**
14
     * The name and signature of the console command.
15
     *
16
     * @var string
17
     */
18
    protected $signature = 'websockets:restart';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Restart the Laravel WebSocket Server.';
26
27
    /**
28
     * Execute the console command.
29
     *
30
     * @return mixed
31
     */
32
    public function handle()
33
    {
34
        Cache::forever('beyondcode:websockets:restart', $this->currentTime());
35
36
        $this->info('Broadcasting WebSocket server restart signal.');
37
    }
38
}
39