@@ -151,10 +151,21 @@ public function queryAll(string $query, array $bindings = []): array
151
151
throw new QueryException ($ query , [], new Exception ($ statement ->error ));
152
152
}
153
153
154
- return $ statement ->fetchAll (SW_PGSQL_ASSOC );
154
+ return $ statement ->fetchAll ();
155
155
}
156
156
157
- public function str_replace_once ($ needle , $ replace , $ haystack )
157
+ /**
158
+ * @param string $needle
159
+ * @param string $replace
160
+ * @param string $haystack
161
+ * @deprecated ,using `strReplaceOnce` instead
162
+ */
163
+ public function str_replace_once ($ needle , $ replace , $ haystack ): array |string
164
+ {
165
+ return $ this ->strReplaceOnce ($ needle , $ replace , $ haystack );
166
+ }
167
+
168
+ public function strReplaceOnce (string $ needle , string $ replace , string $ haystack ): array |string
158
169
{
159
170
// Looks for the first occurence of $needle in $haystack
160
171
// and replaces it with $replace.
@@ -219,7 +230,7 @@ protected function prepare(string $query, bool $useReadPdo = true): PostgreSQLSt
219
230
{
220
231
$ num = 1 ;
221
232
while (strpos ($ query , '? ' )) {
222
- $ query = $ this ->str_replace_once ('? ' , '$ ' . $ num ++, $ query );
233
+ $ query = $ this ->strReplaceOnce ('? ' , '$ ' . $ num ++, $ query );
223
234
}
224
235
225
236
/** @var PostgreSQL $pdo */
0 commit comments