Test Failed
Push — feature-laravel-5.4 ( 89a18e...6715ec )
by Kirill
04:11
created

StartWebSocketServer::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of laravel.su package.
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace App\Console\Commands;
11
12
use Carbon\Carbon;
13
use App\Models\Bot;
14
use App\Models\Article;
15
use Illuminate\Console\Command;
16
use App\Services\DataProviders\Manager;
17
use App\Services\DataProviders\ExternalArticle;
18
use App\Services\DataProviders\DataProviderInterface;
19
use Illuminate\Contracts\Container\Container;
20
use Illuminate\Database\Eloquent\Relations\MorphMany;
21
use Service\WebSocket\Server;
22
23
/**
24
 * Class StartWebSocketServer.
25
 */
26
class StartWebSocketServer extends Command
27
{
28
    /**
29
     * The name and signature of the console command.
30
     * @var string
31
     */
32
    protected $signature = 'ws:start';
33
34
    /**
35
     * The console command description.
36
     * @var string
37
     */
38
    protected $description = 'Start a web socket server';
39
40
    /**
41
     * @param Container $app
42
     * @throws \RuntimeException
43
     */
44
    public function handle(Container $app)
45
    {
46
        $this->info('Starting a WebSocket server');
47
48
        $server = Server::new($app);
49
        $server->run();
50
    }
51
}
52