Completed
Push — master ( e1c388...7bf58d )
by
unknown
12:55 queued 10:58
created

ShellOption::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 3
nc 2
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPSu\ShellCommandBuilder\Literal;
6
7
use PHPSu\ShellCommandBuilder\ShellInterface;
8
9
final class ShellOption extends ShellWord
10
{
11
    protected $isOption = true;
12
    protected $prefix = ShellWord::OPTION_CONTROL;
13
14
    /**
15
     * ShellArgument constructor.
16
     * @param string $option
17
     * @param ShellInterface|string $value
18
     */
19
    public function __construct(string $option, $value = '')
20
    {
21
        if (is_string($value) && empty($value)) {
22
            $this->delimiter = '';
23
        }
24
        parent::__construct($option, $value);
25
    }
26
}
27