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