@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return $result->fetchAll(_PDO::FETCH_ASSOC); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - public function one(string $table, array $conditions, array $options = []): ?array |
|
| 89 | + public function one(string $table, array $conditions, array $options = []): ? array |
|
| 90 | 90 | { |
| 91 | 91 | $result = $this->find($table, $conditions, $options); |
| 92 | 92 | $result = iterator_to_array($result); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | if (empty($conditions)) { |
| 139 | 139 | return ""; |
| 140 | 140 | } |
| 141 | - $fun = function ($o, $v) use ($conditions) { |
|
| 141 | + $fun = function($o, $v) use ($conditions) { |
|
| 142 | 142 | if (is_array($conditions[$v])) { |
| 143 | 143 | $qa = []; |
| 144 | 144 | foreach ($conditions[$v] as $key => $value) { |
@@ -183,8 +183,8 @@ discard block |
||
| 183 | 183 | private function bindPaginationToStatement(array $options, $stmt): void |
| 184 | 184 | { |
| 185 | 185 | if (array_key_exists('limit', $options)) { |
| 186 | - $stmt->bindValue(":o_offset", (int)($options['offset'] ?? 0), _PDO::PARAM_INT); |
|
| 187 | - $stmt->bindValue(":o_limit", (int)$options['limit'], _PDO::PARAM_INT); |
|
| 186 | + $stmt->bindValue(":o_offset", (int) ($options['offset'] ?? 0), _PDO::PARAM_INT); |
|
| 187 | + $stmt->bindValue(":o_limit", (int) $options['limit'], _PDO::PARAM_INT); |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | private function data(array $data): string |
| 216 | 216 | { |
| 217 | - $fun = function ($o, $v) { |
|
| 217 | + $fun = function($o, $v) { |
|
| 218 | 218 | return "{$o}, {$v} = :d_{$v}"; |
| 219 | 219 | }; |
| 220 | 220 | return trim((string) array_reduce(array_keys($data), $fun, ""), ", "); |
@@ -164,7 +164,9 @@ |
||
| 164 | 164 | { |
| 165 | 165 | $out = []; |
| 166 | 166 | foreach ($conditions as $k => $v) { |
| 167 | - if (is_array($v)) $v = join(',', $v); |
|
| 167 | + if (is_array($v)) { |
|
| 168 | + $v = join(',', $v); |
|
| 169 | + } |
|
| 168 | 170 | $out[] = "c_{$k}:'{$v}'"; |
| 169 | 171 | } |
| 170 | 172 | foreach ($data as $k => $v) { |