1 | <?php |
||
10 | final class FlagsItem implements ItemInterface |
||
11 | { |
||
12 | public const OPERATOR_REPLACE = ''; |
||
13 | |||
14 | public const OPERATOR_ADD = '+'; |
||
15 | |||
16 | public const OPERATOR_REMOVE = '-'; |
||
17 | |||
18 | private const OPERATORS = [ |
||
19 | self::OPERATOR_REPLACE => true, |
||
20 | self::OPERATOR_ADD => true, |
||
21 | self::OPERATOR_REMOVE => true, |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * @var FlagParenthesizedList |
||
26 | */ |
||
27 | private $flagList; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $silent = false; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $operator = ''; |
||
38 | |||
39 | /** |
||
40 | * @param FlagParenthesizedList $flagList |
||
41 | * @param string $operator |
||
42 | */ |
||
43 | 9 | public function __construct(FlagParenthesizedList $flagList, string $operator = '') |
|
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | 8 | public function getName(): string |
|
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | 7 | public function __toString(): string |
|
72 | |||
73 | /** |
||
74 | * @param FlagParenthesizedList $flagParenthesizedList |
||
75 | * @param string $operator |
||
76 | * @return FlagsItem |
||
77 | */ |
||
78 | 3 | public static function silent(FlagParenthesizedList $flagParenthesizedList, string $operator = ''): self |
|
84 | |||
85 | /** |
||
86 | * @param string $list |
||
87 | * @return FlagsItem |
||
88 | */ |
||
89 | 6 | public static function fromString(string $list): self |
|
142 | } |
||
143 |