More yoda conditions

This commit is contained in:
David Stone
2025-02-09 12:30:02 -07:00
parent d9122a410d
commit 0a4c81c105
97 changed files with 323 additions and 289 deletions

View File

@ -443,7 +443,7 @@ if ( ! class_exists('MUCD_Data') ) {
MUCD_Duplicate::write_log('Result :' . var_export($results, true));
}
if ($wpdb->last_error != '') {
if ('' != $wpdb->last_error) {
self::sql_error($sql_query, $wpdb->last_error);
}

View File

@ -208,7 +208,7 @@ if ( ! class_exists('MUCD_Duplicate') ) {
*/
public static function init_log($data): void {
// INIT LOG AND SAVE OPTION
if (isset($data['log']) && $data['log'] == 'yes' ) {
if (isset($data['log']) && 'yes' == $data['log'] ) {
if (isset($data['log-path']) && ! empty($data['log-path'])) {
$log_name = @date('Y_m_d_His') . '-' . $data['domain'] . '.log';
if (! str_ends_with((string) $data['log-path'], '/')) {

View File

@ -139,7 +139,7 @@ if ( ! class_exists('MUCD_Log') ) {
* @return boolean True on success, False on failure
*/
public function write_log($message): bool {
if ($this->mod !== false && $this->can_write() ) {
if (false !== $this->mod && $this->can_write() ) {
$time = @date('[d/M/Y:H:i:s]');
fwrite($this->fp, "$time $message" . "\r\n");
return true;