]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/classes/QnA_Answer.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / QnA / classes / QnA_Answer.php
index 2aa69cf5a301aab87e845402d7647cf8e040e804..d04159f9b9375e529240ffdb49d71ed331c7830c 100644 (file)
@@ -105,7 +105,7 @@ class QnA_Answer extends Managed_DataObject
      *
      * @return QnA_Answer found response or null
      */
-    static function getByNotice($notice)
+    static function getByNotice(Notice $notice)
     {
         $answer = self::getKV('uri', $notice->uri);
         if (empty($answer)) {
@@ -124,7 +124,7 @@ class QnA_Answer extends Managed_DataObject
         return Notice::getKV('uri', $this->uri);
     }
 
-    static function fromNotice($notice)
+    static function fromNotice(Notice $notice)
     {
         return QnA_Answer::getKV('uri', $notice->uri);
     }
@@ -179,7 +179,7 @@ class QnA_Answer extends Managed_DataObject
         );
     }
 
-    static function toHTML($profile, $question, $answer)
+    static function toHTML(Profile $profile, $question, $answer)
     {
         $notice = $question->getNotice();
 
@@ -237,12 +237,8 @@ class QnA_Answer extends Managed_DataObject
      *
      * @return Notice saved notice
      */
-    static function saveNew($profile, $question, $text, $options = null)
+    static function saveNew(Profile $profile, $question, $text, array $options = array())
     {
-        if (empty($options)) {
-            $options = array();
-        }
-
         $answer              = new QnA_Answer();
         $answer->id          = UUID::gen();
         $answer->profile_id  = $profile->id;
@@ -256,7 +252,7 @@ class QnA_Answer extends Managed_DataObject
             array('id' => $answer->id)
         );
 
-        common_log(LOG_DEBUG, "Saving answer: $answer->id, $answer->uri");
+        common_debug("Saving answer: $answer->id, $answer->uri");
         $answer->insert();
 
         $content  = sprintf(