Total Complexity | 8 |
Total Lines | 71 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class MySQLLogicBindings implements LogicBindingInterface |
||
10 | { |
||
11 | /** |
||
12 | * Bind a boolean value as bool or null. |
||
13 | * |
||
14 | * @param int|bool|null $value |
||
15 | * |
||
16 | * @return array |
||
17 | * @throws TypeError |
||
18 | */ |
||
19 | 2 | public function bBoolNullable($value = null): array |
|
20 | { |
||
21 | // use NULL |
||
22 | 2 | if ($value === null) { |
|
23 | 1 | return [null, PDO::PARAM_NULL]; |
|
24 | } |
||
25 | |||
26 | 1 | return $this->bBool($value); |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * Bind a boolean value as bool. |
||
31 | * |
||
32 | * @param int|bool|null $value |
||
33 | * |
||
34 | * @return array |
||
35 | * @throws TypeError |
||
36 | */ |
||
37 | 3 | public function bBool($value = null): array |
|
44 | } |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Bind a boolean value as int or null. |
||
49 | * |
||
50 | * @param int|bool|null $value |
||
51 | * |
||
52 | * @return array |
||
53 | * @throws TypeError |
||
54 | */ |
||
55 | 2 | public function bBoolIntNullable($value = null): array |
|
56 | { |
||
57 | // use NULL |
||
58 | 2 | if ($value === null) { |
|
59 | 1 | return [null, PDO::PARAM_NULL]; |
|
60 | } |
||
61 | |||
62 | 1 | return $this->bBoolInt($value); |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * Bind a boolean value as int. |
||
67 | * |
||
68 | * @param int|bool|null $value |
||
69 | * |
||
70 | * @return array |
||
71 | * @throws TypeError |
||
72 | */ |
||
73 | 3 | public function bBoolInt($value = null): array |
|
80 | } |
||
81 | } |
||
82 |