Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
30 | public function confirmed() |
||
31 | { |
||
32 | if (in_array($this->default, ["y", "yes"], true)) { |
||
33 | $this->prompt .= " [Y/n]"; |
||
34 | } else { |
||
35 | $this->prompt .= " [y/N]"; |
||
36 | } |
||
37 | |||
38 | $this->accept(['y', 'yes', 'n', 'no'], false); |
||
39 | |||
40 | $response = strtolower($this->prompt()); |
||
41 | |||
42 | return (substr($response, 0, 1) === 'y'); |
||
43 | } |
||
44 | } |
||
45 |