Skip to content

Commit

Permalink
PHPCS: Fix more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JJJ committed Jun 18, 2024
1 parent db8b471 commit 23b9d2f
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions ludicrousdb/includes/class-ludicrousdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,13 @@ public function db_connect( $query = '' ) {
) {

// If it is the last lagged slave and it is with the best preference we will ignore its lag
if ( ! isset( $unique_lagged_slaves[ $host_and_port ] ) && ( (int) $this->unique_servers === count( $unique_lagged_slaves ) + 1 ) && $group == $min_group ) {
if (
! isset( $unique_lagged_slaves[ $host_and_port ] )
&&
( (int) $this->unique_servers === count( $unique_lagged_slaves ) + 1 )
&&
( $group === $min_group )
) {
$this->lag_threshold = null;
} else {
$unique_lagged_slaves[ $host_and_port ] = $this->lag;
Expand Down Expand Up @@ -795,16 +801,16 @@ public function db_connect( $query = '' ) {
* We don't disconnect if it is the last lagged slave and it is with the best preference.
*/
if ( empty( $use_master )
&& empty( $write )
&& empty( $this->ignore_slave_lag )
&& isset( $this->lag_threshold )
&& ! isset( $server['host'] )
&& ( $lagged_status !== DB_LAG_OK )
&& ( $lagged_status = $this->get_lag() ) === DB_LAG_BEHIND
&& ! (
&& empty( $write )
&& empty( $this->ignore_slave_lag )
&& isset( $this->lag_threshold )
&& ! isset( $server['host'] )
&& ( $lagged_status !== DB_LAG_OK )
&& ( $lagged_status = $this->get_lag() ) === DB_LAG_BEHIND // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition
&& ! (
! isset( $unique_lagged_slaves[ $host_and_port ] )
&& ( (int) $this->unique_servers === ( count( $unique_lagged_slaves ) + 1 ) )
&& ( $group == $min_group )
&& ( $group === $min_group )
)
) {
$unique_lagged_slaves[ $host_and_port ] = $this->lag;
Expand Down

0 comments on commit 23b9d2f

Please sign in to comment.