From 9edde007b15dd1840df03cd3cb4fbf7ff400b3f0 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 1 Jan 2014 20:30:57 +0100 Subject: [PATCH] instanceof checks for better typing --- lib/apiaction.php | 2 +- lib/apignusocialoauthdatastore.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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