]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
instanceof checks for better typing
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 1 Jan 2014 19:30:57 +0000 (20:30 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 1 Jan 2014 19:30:57 +0000 (20:30 +0100)
lib/apiaction.php
lib/apignusocialoauthdatastore.php

index d151f4c51fd7f461f639235d9db39d87d4d11211..dd4047125a0443f6218ebb57bc497e4e6e333266 100644 (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;
index 7550ec5f6fa8723e4b240eb6c5724cd08c3d70f7..da412df8d298bfe9a55a946a37b4df71c7a79ecc 100644 (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