Test Failed
Push — master ( 817d84...d52e3d )
by Raffael
05:44
created

Cli::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 9
cp 0
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * balloon
7
 *
8
 * @copyright   Copryright (c) 2012-2019 gyselroth GmbH (https://gyselroth.com)
9
 * @license     GPL-3.0 https://opensource.org/licenses/GPL-3.0
10
 */
11
12
namespace Balloon\App\Elasticsearch\Constructor;
13
14
use Balloon\App\Elasticsearch\Console;
15
use GetOpt\GetOpt;
16
17
class Cli
18
{
19
    /**
20
     * GetOpt.
21
     *
22
     * @var GetOpt
23
     */
24
    protected $getopt;
25
26
    /**
27
     * Constructor.
28
     */
29
    public function __construct(GetOpt $getopt)
30
    {
31
        $this->getopt = $getopt;
32
        $getopt->addCommands([
33
            \GetOpt\Command::create('elasticsearch', Console\Elasticsearch::class)
34
                ->addOptions(Console\Elasticsearch::getOptions())
35
                ->addOperands(Console\Elasticsearch::getOperands()),
36
        ]);
37
    }
38
}
39