Type of Database (MySQL, MSSQL, SQLite...): Postgresql
System (Liunx|Windows|Mac):Linux
Describe the Problem
执行log()方法报错
TypeError: Medoo\Medoo::quote(): Argument #1 ($string) must be of type string, float given, called in /www/webman/vendor/catfan/medoo/src/Medoo.php on line 607 and defined in /www/webman/vendor/catfan/medoo/src/Medoo.php:696
Stack trace:
#0 /www/webman/vendor/catfan/medoo/src/Medoo.php(607): Medoo\Medoo->quote(555.1)
Information
Describe the Problem 执行log()方法报错
TypeError: Medoo\Medoo::quote(): Argument #1 ($string) must be of type string, float given, called in /www/webman/vendor/catfan/medoo/src/Medoo.php on line 607 and defined in /www/webman/vendor/catfan/medoo/src/Medoo.php:696 Stack trace: #0 /www/webman/vendor/catfan/medoo/src/Medoo.php(607): Medoo\Medoo->quote(555.1)
1 /www/webman/vendor/catfan/medoo/src/Medoo.php(2205): Medoo\Medoo->generate('UPDATE \"page\" S...', Array)
2 [internal function]: Medoo\Medoo->Medoo\{closure}(Array)
3 /www/webman/vendor/catfan/medoo/src/Medoo.php(2203): array_map(Object(Closure), Array)
4 /www/webman/app/wmapi/controller/PageController.php(215): Medoo\Medoo->log()
问题出在 https://github.com/catfan/Medoo/blob/eb1ad19d127bd358b9a44abc60166b4a2c19a988/src/Medoo.php#L749 这里 double 类型被看做了字符串,但是555.1不是字符串, 导致调用quote函数时参数类型检查错误
https://github.com/catfan/Medoo/blob/eb1ad19d127bd358b9a44abc60166b4a2c19a988/src/Medoo.php#L607
请看看这个如何修改,或者是在调用的时候,类型强制转换为 string