Configure::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Options configure
4
 * User: moyo
5
 * Date: 13/12/2017
6
 * Time: 4:29 PM
7
 */
8
9
namespace Carno\Console;
10
11
use Symfony\Component\Console\Command\Command;
12
13
class Configure
14
{
15
    /**
16
     * @var Command
17
     */
18
    private $cmd = null;
19
20
    /**
21
     * Configure constructor.
22
     * @param Command $cmd
23
     */
24
    public function __construct(Command $cmd)
25
    {
26
        $this->cmd = $cmd;
27
    }
28
29
    /**
30
     * Adds an option.
31
     *
32
     * @param string $name        The option name
33
     * @param string $shortcut    The shortcut (can be null)
34
     * @param int    $mode        The option mode: One of the InputOption::VALUE_* constants
35
     * @param string $description A description text
36
     * @param mixed  $default     The default value (must be null for InputOption::VALUE_NONE)
37
     *
38
     * @return static
39
     */
40
    public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) : self
41
    {
42
        $this->cmd->addOption($name, $shortcut, $mode, $description, $default);
43
        return $this;
44
    }
45
}
46