Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 10 | public function setConfirm($confirm) |
|
37 | { |
||
38 | 10 | if (is_array($confirm)) { |
|
39 | 9 | $confirm = new Confirmation($confirm); |
|
40 | } |
||
41 | |||
42 | 10 | if ($confirm instanceof Confirmation) { |
|
43 | 9 | $this->confirm = $confirm; |
|
44 | |||
45 | 9 | return $this; |
|
46 | } |
||
47 | |||
48 | 1 | throw new InvalidArgumentException('Confirm must be a keyed array or '.Confirmation::class.' object'); |
|
49 | } |
||
51 |