From: Mikael Nordfeldth Date: Wed, 1 Jan 2014 19:30:57 +0000 (+0100) Subject: instanceof checks for better typing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9edde007b15dd1840df03cd3cb4fbf7ff400b3f0;p=quix0rs-gnu-social.git instanceof checks for better typing --- diff --git a/lib/apiaction.php b/lib/apiaction.php index d151f4c51f..dd4047125a 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -1466,7 +1466,7 @@ class ApiAction extends Action } else if ($this->arg('screen_name')) { $nickname = common_canonical_nickname($this->arg('screen_name')); $user = User::getKV('nickname', $nickname); - return $user ? $user->getProfile() : null; + return $user instanceof User ? $user->getProfile() : null; } else { // Fall back to trying the currently authenticated user return $this->scoped; diff --git a/lib/apignusocialoauthdatastore.php b/lib/apignusocialoauthdatastore.php index 7550ec5f6f..da412df8d2 100644 --- a/lib/apignusocialoauthdatastore.php +++ b/lib/apignusocialoauthdatastore.php @@ -30,7 +30,7 @@ class ApiGNUsocialOAuthDataStore extends OAuthDataStore { $con = Consumer::getKV('consumer_key', $consumerKey); - if (!$con) { + if (!$con instanceof Consumer) { // Create an anon consumer and anon application if one // doesn't exist already