Completed
Push — master ( 716db6...a32038 )
by Alireza
02:53
created

ServerCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Server list
5
 *
6
 * @author Alireza Josheghani <[email protected]>
7
 * @since  29 Sep 2018
8
 */
9
10
namespace Josh\Console\Commands;
11
12
use Josh\Console\Models\Server;
13
use Josh\Json\Database\Database;
14
use Josh\Json\Database\Driver\JsonDriver;
15
use Symfony\Component\Console\Command\Command;
16
17
class ServerCommand extends Command
18
{
19
    /**
20
     * Server model instance
21
     *
22
     * @var Server
23
     */
24
    protected $model;
25
26
    /**
27
     * ServerCommand constructor.
28
     *
29
     * @param string|null $name
30
     */
31
    public function __construct(string $name = null)
32
    {
33
        parent::__construct($name);
34
        Database::setDriver(new JsonDriver(base_path("/servers.json")));
35
        $this->model = new Server();
36
    }
37
}
38