Skip to content

Commit

Permalink
解决 php 8.1 兼容问题 (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
NHZEX authored Nov 14, 2021
1 parent 559177c commit d8c7ee8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/Db/Drivers/Swoole/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ public function getInstance()
/**
* @return mixed|false
*/
#[\ReturnTypeWillChange]
public function current()
{
return current($this->result);
Expand All @@ -343,6 +344,7 @@ public function current()
/**
* @return int|string|null
*/
#[\ReturnTypeWillChange]
public function key()
{
return key($this->result);
Expand All @@ -367,6 +369,7 @@ public function rewind(): void
/**
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function valid()
{
return false !== $this->current();
Expand Down
8 changes: 4 additions & 4 deletions tests/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
'resource' => [
'dbClass' => 'PdoPgsqlDriver',
'host' => imiGetEnv('PGSQL_SERVER_HOST', '127.0.0.1'),
'port' => imiGetEnv('PGSQL_SERVER_PORT', 5432),
'port' => (int) imiGetEnv('PGSQL_SERVER_PORT', 5432),
'username' => imiGetEnv('PGSQL_SERVER_USERNAME', 'root'),
'password' => imiGetEnv('PGSQL_SERVER_PASSWORD', 'root'),
'database' => 'db_imi_test',
Expand All @@ -84,7 +84,7 @@
'resource' => [
'dbClass' => 'PdoPgsqlDriver',
'host' => imiGetEnv('PGSQL_SERVER_HOST', '127.0.0.1'),
'port' => imiGetEnv('PGSQL_SERVER_PORT', 5432),
'port' => (int) imiGetEnv('PGSQL_SERVER_PORT', 5432),
'username' => imiGetEnv('PGSQL_SERVER_USERNAME', 'root'),
'password' => imiGetEnv('PGSQL_SERVER_PASSWORD', 'root'),
'database' => 'db_imi_test',
Expand All @@ -105,7 +105,7 @@
'resource' => [
'dbClass' => 'SwoolePgsqlDriver',
'host' => imiGetEnv('PGSQL_SERVER_HOST', '127.0.0.1'),
'port' => imiGetEnv('PGSQL_SERVER_PORT', 5432),
'port' => (int) imiGetEnv('PGSQL_SERVER_PORT', 5432),
'username' => imiGetEnv('PGSQL_SERVER_USERNAME', 'root'),
'password' => imiGetEnv('PGSQL_SERVER_PASSWORD', 'root'),
'database' => 'db_imi_test',
Expand All @@ -120,7 +120,7 @@
'maindb' => [
'dbClass' => 'PdoPgsqlDriver',
'host' => imiGetEnv('PGSQL_SERVER_HOST', '127.0.0.1'),
'port' => imiGetEnv('PGSQL_SERVER_PORT', 5432),
'port' => (int) imiGetEnv('PGSQL_SERVER_PORT', 5432),
'username' => imiGetEnv('PGSQL_SERVER_USERNAME', 'root'),
'password' => imiGetEnv('PGSQL_SERVER_PASSWORD', 'root'),
'database' => 'db_imi_test',
Expand Down

0 comments on commit d8c7ee8

Please sign in to comment.