From b973ad645299344eed382fc5a2c478e320214e1f Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Thu, 24 Mar 2016 22:27:20 +0200 Subject: [PATCH] Simplify a couple of conditions. In theory, $state and $state->update should always be either NULL or objects. That means isset() fully covers the possibilities and we don't need the additional empty() checks. --- plugin-update-checker.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-update-checker.php b/plugin-update-checker.php index 9900f43..9bc40bb 100644 --- a/plugin-update-checker.php +++ b/plugin-update-checker.php @@ -353,7 +353,7 @@ class PluginUpdateChecker_3_0 { $state = null; } - if ( !empty($state) && isset($state->update) && is_object($state->update) ){ + if ( isset($state, $state->update) && is_object($state->update) ) { $state->update = PluginUpdate_3_0::fromObject($state->update); } return $state; @@ -594,8 +594,8 @@ class PluginUpdateChecker_3_0 { public function getUpdate() { $state = $this->getUpdateState(); /** @var StdClass $state */ - //Is there an update available insert? - if ( !empty($state) && isset($state->update) && !empty($state->update) ){ + //Is there an update available? + if ( isset($state, $state->update) ) { $update = $state->update; //Check if the update is actually newer than the currently installed version. $installedVersion = $this->getInstalledVersion();