Skip to content

Commit 5a65ee3

Browse files
refactor: Remove dead code from MySQLi Connection related to PHP 5 (#9887)
* Remove dead code * Update PHPStan baselines
1 parent 5ab52ae commit 5a65ee3

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

system/Database/MySQLi/Connection.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,6 @@ public function connect(bool $persistent = false)
207207
$socket,
208208
$clientFlags,
209209
)) {
210-
// Prior to version 5.7.3, MySQL silently downgrades to an unencrypted connection if SSL setup fails
211-
if (($clientFlags & MYSQLI_CLIENT_SSL) !== 0 && version_compare($this->mysqli->client_info, 'mysqlnd 5.7.3', '<=')
212-
&& empty($this->mysqli->query("SHOW STATUS LIKE 'ssl_cipher'")->fetch_object()->Value)
213-
) {
214-
$this->mysqli->close();
215-
$message = 'MySQLi was configured for an SSL connection, but got an unencrypted connection instead!';
216-
log_message('error', $message);
217-
218-
if ($this->DBDebug) {
219-
throw new DatabaseException($message);
220-
}
221-
222-
return false;
223-
}
224-
225210
if (! $this->mysqli->set_charset($this->charset)) {
226211
log_message('error', "Database: Unable to set the configured connection charset ('{$this->charset}').");
227212

utils/phpstan-baseline/empty.notAllowed.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 237 errors
1+
# total 236 errors
22

33
parameters:
44
ignoreErrors:
@@ -74,7 +74,7 @@ parameters:
7474

7575
-
7676
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
77-
count: 11
77+
count: 10
7878
path: ../../system/Database/MySQLi/Connection.php
7979

8080
-

utils/phpstan-baseline/loader.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 2772 errors
1+
# total 2771 errors
22

33
includes:
44
- argument.type.neon

0 commit comments

Comments
 (0)