ShellOption   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPSu\ShellCommandBuilder\Literal;
6
7
use PHPSu\ShellCommandBuilder\Exception\ShellBuilderException;
8
use PHPSu\ShellCommandBuilder\ShellInterface;
9
10
/**
11
 * @internal
12
 * @psalm-internal PHPSu\ShellCommandBuilder
13
 */
14
final class ShellOption extends ShellWord
15
{
16
    protected $isOption = true;
17
    protected $prefix = ShellWord::OPTION_CONTROL;
18
19
    /**
20
     * ShellArgument constructor.
21
     * @param string $option
22
     * @param ShellInterface|string $value
23
     * @throws ShellBuilderException
24
     */
25
    public function __construct(string $option, $value = '')
26
    {
27
        if (is_string($value) && empty($value)) {
28
            $this->delimiter = '';
29
        }
30
        parent::__construct($option, $value);
31
    }
32
}
33