Conditions | 4 |
Paths | 6 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | protected function parse(string $raw) |
||
34 | { |
||
35 | if (\strpos($raw, '-with-') !== false) { |
||
36 | $this->default = false; |
||
37 | } elseif (\strpos($raw, '-no-') !== false) { |
||
38 | $this->default = true; |
||
39 | } |
||
40 | |||
41 | $parts = \preg_split('/[\s,\|]+/', $raw); |
||
42 | |||
43 | $this->short = $this->long = $parts[0]; |
||
44 | if (isset($parts[1])) { |
||
45 | $this->long = $parts[1]; |
||
46 | } |
||
47 | |||
48 | $this->name = \str_replace(['--', 'no-', 'with-'], '', $this->long); |
||
49 | } |
||
93 |