[ticket/17176] Resolve psalm issues after PHP version update

PHPBB3-17176
This commit is contained in:
Marc Alexander 2023-08-20 09:54:07 +02:00
parent b82c880375
commit ac9659c38f
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
4 changed files with 5 additions and 5 deletions

View file

@ -1330,7 +1330,7 @@ abstract class driver implements driver_interface
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function clean_query_id($query_id) public function clean_query_id(mixed $query_id): int|string
{ {
// Some DBMS functions accept/return objects and/or resources instead if identifiers // Some DBMS functions accept/return objects and/or resources instead if identifiers
// Attempting to use objects/resources as array keys will throw error, hence correctly handle all cases // Attempting to use objects/resources as array keys will throw error, hence correctly handle all cases

View file

@ -499,9 +499,9 @@ interface driver_interface
/** /**
* Ensure query ID can be used by cache * Ensure query ID can be used by cache
* *
* @param resource|int|string $query_id Mixed type query id * @param mixed $query_id Mixed type query id
* *
* @return int|string Query id in string or integer format * @return int|string Query id in string or integer format
*/ */
public function clean_query_id($query_id); public function clean_query_id(mixed $query_id): int|string;
} }

View file

@ -478,7 +478,7 @@ class factory implements driver_interface
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function clean_query_id($query_id) public function clean_query_id(mixed $query_id): int|string
{ {
return $this->get_driver()->clean_query_id($query_id); return $this->get_driver()->clean_query_id($query_id);
} }

View file

@ -432,7 +432,7 @@ class postgres extends \phpbb\db\driver\driver
protected function _sql_close(): bool protected function _sql_close(): bool
{ {
// Released resources are already closed, return true in this case // Released resources are already closed, return true in this case
if (!is_resource($this->db_connect_id)) if (!$this->db_connect_id instanceof \PgSql\Connection)
{ {
return true; return true;
} }