@@ -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); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if (empty($conditions)) { |
| 132 | 132 | return ""; |
| 133 | 133 | } |
| 134 | - $fun = function ($o, $v) { |
|
| 134 | + $fun = function($o, $v) { |
|
| 135 | 135 | return "{$o}{$v} = :c_{$v}"; |
| 136 | 136 | }; |
| 137 | 137 | $where = array_reduce(array_keys($conditions), $fun, ""); |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | private function bindPaginationToStatement(array $options, $stmt): void |
| 166 | 166 | { |
| 167 | 167 | if (array_key_exists('limit', $options)) { |
| 168 | - $stmt->bindValue(":o_offset", (int)($options['offset'] ?? 0), _PDO::PARAM_INT); |
|
| 169 | - $stmt->bindValue(":o_limit", (int)$options['limit'], _PDO::PARAM_INT); |
|
| 168 | + $stmt->bindValue(":o_offset", (int) ($options['offset'] ?? 0), _PDO::PARAM_INT); |
|
| 169 | + $stmt->bindValue(":o_limit", (int) $options['limit'], _PDO::PARAM_INT); |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | private function data(array $data): string |
| 198 | 198 | { |
| 199 | - $fun = function ($o, $v) { |
|
| 199 | + $fun = function($o, $v) { |
|
| 200 | 200 | return "{$o}, {$v} = :d_{$v}"; |
| 201 | 201 | }; |
| 202 | 202 | return trim((string) array_reduce(array_keys($data), $fun, ""), ", "); |