diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index 0eae308fe6..598e21a03b 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -2133,17 +2133,11 @@ class DatabaseInterface implements DbalInterface /** * returns a string that represents the client library version * - * @param int $link link type - * * @return string MySQL client library version */ - public function getClientInfo($link = self::CONNECT_USER): string + public function getClientInfo(): string { - if (! isset($this->links[$link])) { - return ''; - } - - return $this->extension->getClientInfo($this->links[$link]); + return $this->extension->getClientInfo(); } /** diff --git a/libraries/classes/Dbal/DbalInterface.php b/libraries/classes/Dbal/DbalInterface.php index c0da4c1f8e..0e02c4d28a 100644 --- a/libraries/classes/Dbal/DbalInterface.php +++ b/libraries/classes/Dbal/DbalInterface.php @@ -621,11 +621,9 @@ interface DbalInterface /** * returns a string that represents the client library version * - * @param int $link link type - * * @return string MySQL client library version */ - public function getClientInfo($link = DatabaseInterface::CONNECT_USER): string; + public function getClientInfo(): string; /** * returns last error message or false if no errors occurred diff --git a/libraries/classes/Dbal/DbiExtension.php b/libraries/classes/Dbal/DbiExtension.php index 102294680b..fc42525037 100644 --- a/libraries/classes/Dbal/DbiExtension.php +++ b/libraries/classes/Dbal/DbiExtension.php @@ -146,11 +146,9 @@ interface DbiExtension /** * returns a string that represents the client library version * - * @param object $link mysql link - * * @return string MySQL client library version */ - public function getClientInfo($link); + public function getClientInfo(); /** * returns last error message or false if no errors occurred diff --git a/libraries/classes/Dbal/DbiMysqli.php b/libraries/classes/Dbal/DbiMysqli.php index 5c3db07e65..0a2592e1ec 100644 --- a/libraries/classes/Dbal/DbiMysqli.php +++ b/libraries/classes/Dbal/DbiMysqli.php @@ -74,7 +74,6 @@ use function is_bool; use function mysqli_init; use function stripos; use function trigger_error; -use const PHP_VERSION_ID; use function mysqli_get_client_info; /** @@ -393,11 +392,9 @@ class DbiMysqli implements DbiExtension /** * returns a string that represents the client library version * - * @param mysqli $mysqli mysql link - * * @return string MySQL client library version */ - public function getClientInfo($mysqli) + public function getClientInfo() { return mysqli_get_client_info(); } diff --git a/test/classes/Dbal/DbiDummyTest.php b/test/classes/Dbal/DbiDummyTest.php index 26f1215c9e..14c151c7c8 100644 --- a/test/classes/Dbal/DbiDummyTest.php +++ b/test/classes/Dbal/DbiDummyTest.php @@ -33,10 +33,9 @@ class DbiDummyTest extends AbstractTestCase public function testGetClientInfo(): void { - $obj = (object) []; - $this->assertNotEmpty($this->object->getClientInfo($obj)); + $this->assertNotEmpty($this->object->getClientInfo()); // Call the DatabaseInterface - $this->assertSame($GLOBALS['dbi']->getClientInfo(), $this->object->getClientInfo($obj)); + $this->assertSame($GLOBALS['dbi']->getClientInfo(), $this->object->getClientInfo()); } /** diff --git a/test/classes/Dbal/DbiMysqliTest.php b/test/classes/Dbal/DbiMysqliTest.php index 22c34c4f10..282c4c706a 100644 --- a/test/classes/Dbal/DbiMysqliTest.php +++ b/test/classes/Dbal/DbiMysqliTest.php @@ -11,7 +11,6 @@ use PhpMyAdmin\Tests\AbstractTestCase; use const MYSQLI_ASSOC; use const MYSQLI_BOTH; use const MYSQLI_NUM; -use const PHP_VERSION_ID; class DbiMysqliTest extends AbstractTestCase { @@ -32,13 +31,7 @@ class DbiMysqliTest extends AbstractTestCase public function testGetClientInfo(): void { - if (PHP_VERSION_ID < 80100) { - $this->markTestSkipped('This test requires PHP 8.1'); - } - - /** @var mysqli $obj */ - $obj = null; - $this->assertNotEmpty($this->object->getClientInfo($obj)); + $this->assertNotEmpty($this->object->getClientInfo()); } /** diff --git a/test/classes/Stubs/DbiDummy.php b/test/classes/Stubs/DbiDummy.php index bf54f23a54..7cf8c64dea 100644 --- a/test/classes/Stubs/DbiDummy.php +++ b/test/classes/Stubs/DbiDummy.php @@ -354,11 +354,9 @@ class DbiDummy implements DbiExtension /** * returns a string that represents the client library version * - * @param object $link connection link - * * @return string MySQL client library version */ - public function getClientInfo($link) + public function getClientInfo() { return 'libmysql - mysqlnd x.x.x-dev (phpMyAdmin tests)'; }