Conditions | 5 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | public function bBoolInt($value = null, bool $null = false): array |
||
45 | { |
||
46 | // use NULL |
||
47 | if ($value === null && $null) { |
||
48 | return [null, PDO::PARAM_NULL]; |
||
49 | } |
||
50 | |||
51 | if ($value === null && $null === false) { |
||
52 | throw new DomainException('Can not bind NULL in boolean spot.'); |
||
53 | } |
||
54 | |||
55 | return [(int) $value, PDO::PARAM_INT]; |
||
56 | } |
||
58 |