More yoda conditions
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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'], '/')) {
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user