Skip to content

Commit 343060d

Browse files
committed
- The return type of return $stmtWrapper; (Kir\MySQL\Builder\QueryStatement) is incompatible with the return type declared by the interface Kir\MySQL\Database::query of type PDOStatement.
- The return type of return $stmtWrapper; (Kir\MySQL\Builder\QueryStatement) is incompatible with the return type declared by the interface Kir\MySQL\Database::prepare of type PDOStatement. - The expression preg_replace_callback(&#...;, $func, $expression); of type string|string[] adds the type string[] to the return on line 149 which is incompatible with the return type declared by the interface Kir\MySQL\Database::quoteExpression of type string.
1 parent 70c520a commit 343060d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Database.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace Kir\MySQL;
33

44
use Kir\MySQL\Builder\Exception;
5+
use Kir\MySQL\Builder\QueryStatement;
56
use Kir\MySQL\Builder\RunnableSelect;
67
use Kir\MySQL\Tools\AliasRegistry;
78

@@ -14,14 +15,14 @@ public function getAliasRegistry();
1415
/**
1516
* @param string $query
1617
* @throws Exception
17-
* @return \PDOStatement
18+
* @return QueryStatement
1819
*/
1920
public function query($query);
2021

2122
/**
2223
* @param string $query
2324
* @throws Exception
24-
* @return \PDOStatement
25+
* @return QueryStatement
2526
*/
2627
public function prepare($query);
2728

src/Databases/MySQL.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ public function quoteExpression($expression, array $arguments = array()) {
146146
}
147147
return $value;
148148
};
149-
return preg_replace_callback('/(\\?|:\\d+)/', $func, $expression);
149+
$result = preg_replace_callback('/(\\?|:\\d+)/', $func, $expression);
150+
return (string) $result;
150151
}
151152

152153
/**

0 commit comments

Comments
 (0)