]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Favorite/classes/Fave.php
Found some unreachable code in Favorite
[quix0rs-gnu-social.git] / plugins / Favorite / classes / Fave.php
index 7a18bbfd4471308b35d0c5ba2f4be6aae4981922..6acfb380149dab1daf8fd46dbb4f1347ad1131b5 100644 (file)
@@ -44,7 +44,8 @@ class Fave extends Managed_DataObject
      *
      * @param Profile $profile the local or remote user who likes
      * @param Notice $notice the notice that is liked
-     * @return mixed false on failure, or Fave record on success
+     * @return Fave record on success
+     * @throws Exception on failure
      */
     static function addNew(Profile $profile, Notice $notice) {
 
@@ -66,7 +67,7 @@ class Fave extends Managed_DataObject
                 $fave->insert();
             } catch (ServerException $e) {
                 common_log_db_error($fave, 'INSERT', __FILE__);
-                return false;
+                throw $e;
             }
             self::blowCacheForProfileId($fave->user_id);
             self::blowCacheForNoticeId($fave->notice_id);
@@ -158,7 +159,7 @@ class Fave extends Managed_DataObject
         return $act;
     }
 
-    static function existsForProfile($notice, Profile $scoped)
+    static function existsForProfile(Notice $notice, Profile $scoped)
     {
         $fave = self::pkeyGet(array('user_id'=>$scoped->id, 'notice_id'=>$notice->id));