Skip to content

Commit 7099bb9

Browse files
authored
Update Connection.php
1 parent 3f8ca4e commit 7099bb9

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/Database/Connection.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,22 @@ private function compileNewQuery($query, $bindings)
376376
$bindings = $this->compileBindings($query, $bindings);
377377
$partQuery = explode('?', $query);
378378

379-
$bindings = array_map(fn ($v) => gettype($v) === 'string' ? str_replace('\'', '\'\'', $v) : $v, $bindings);
380-
$bindings = array_map(fn ($v) => gettype($v) === 'string' ? "'{$v}'" : $v, $bindings);
381-
$bindings = array_map(fn ($v) => gettype($v) === 'NULL' ? 'NULL' : $v, $bindings);
379+
$bindings = array_map(function ($v) {
380+
return gettype($v) === 'string' ? str_replace('\'', '\'\'', $v) : $v;
381+
}, $bindings);
382+
383+
$bindings = array_map(function ($v) {
384+
return gettype($v) === 'string' ? "'{$v}'" : $v;
385+
}, $bindings);
386+
387+
$bindings = array_map(function ($v) {
388+
return gettype($v) === 'NULL' ? 'NULL' : $v;
389+
}, $bindings);
390+
391+
$newQuery = join(array_map(function ($k1, $k2) {
392+
return $k1.$k2;
393+
}, $partQuery, $bindings));
382394

383-
$newQuery = join(array_map(fn ($k1, $k2) => $k1.$k2, $partQuery, $bindings));
384395
$newQuery = str_replace('[]', '', $newQuery);
385396
$application_encoding = $this->applicationEncoding;
386397
if (is_null($application_encoding) || $application_encoding == false) {
@@ -427,7 +438,7 @@ public function select($query, $bindings = [], $useReadPdo = true)
427438
$result += $statement->fetchAll($this->getFetchMode());
428439
} while ($statement->nextRowset());
429440

430-
$result = [...$result];
441+
$result = array_merge([], $result);
431442

432443
$application_encoding = $this->applicationEncoding;
433444
if (is_null($application_encoding) || $application_encoding == false) {

0 commit comments

Comments
 (0)