instanceof checks for better typing

This commit is contained in:
Mikael Nordfeldth 2014-01-01 20:30:57 +01:00
parent 915d329b5a
commit 9edde007b1
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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