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

ServerCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

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