]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Merge branch 'master' of git.gnu.io:Quix0r/gnu-social
[quix0rs-gnu-social.git] / classes / Notice.php
index 38e31cb2745189ff0a3b41ee1711f48803318e0e..269b846f24d4f71a87b47b328764d83eece2982c 100644 (file)
@@ -342,7 +342,7 @@ class Notice extends Managed_DataObject
      * Record the given set of hash tags in the db for this notice.
      * Given tag strings will be normalized and checked for dupes.
      */
-    function saveKnownTags($hashtags)
+    function saveKnownTags(array $hashtags)
     {
         //turn each into their canonical tag
         //this is needed to remove dupes before saving e.g. #hash.tag = #hashtag
@@ -1121,7 +1121,7 @@ class Notice extends Managed_DataObject
      *
      * @return void
      */
-    function saveKnownUrls($urls)
+    function saveKnownUrls(array $urls)
     {
         if (common_config('attachments', 'process_links')) {
             // @fixme validation?
@@ -1691,12 +1691,12 @@ class Notice extends Managed_DataObject
             $ids[] = $reply->profile_id;
         }
 
-        $this->_replies[$this->id] = $ids;
+        $this->_setReplies($ids);
 
         return $ids;
     }
 
-    function _setReplies($replies)
+    function _setReplies(array $replies)
     {
         $this->_replies[$this->id] = $replies;
     }
@@ -1773,7 +1773,7 @@ class Notice extends Managed_DataObject
                }
 
                $groups = User_group::multiGet('id', $ids);
-               $this->_groups[$this->id] = $groups->fetchAll();
+               $this->_setGroups($groups->fetchAll());
                return $this->_groups[$this->id];
     }
 
@@ -2645,7 +2645,7 @@ class Notice extends Managed_DataObject
      *
      * @return boolean whether the profile is in the notice's scope
      */
-    function inScope($profile)
+    function inScope(Profile $profile=null)
     {
         if (is_null($profile)) {
             $keypart = sprintf('notice:in-scope-for:%d:null', $this->id);
@@ -2668,7 +2668,7 @@ class Notice extends Managed_DataObject
         return ($result == 1) ? true : false;
     }
 
-    protected function _inScope($profile)
+    protected function _inScope(Profile $profile=null)
     {
         if (!is_null($this->scope)) {
             $scope = $this->scope;
@@ -2737,7 +2737,7 @@ class Notice extends Managed_DataObject
         return !$this->isHiddenSpam($profile);
     }
 
-    function isHiddenSpam($profile) {
+    function isHiddenSpam(Profile $profile=null) {
 
         // Hide posts by silenced users from everyone but moderators.
 
@@ -2802,7 +2802,7 @@ class Notice extends Managed_DataObject
        return $scope;
     }
 
-       static function fillProfiles($notices)
+       static function fillProfiles(array $notices)
        {
                $map = self::getProfiles($notices);
                foreach ($notices as $entry=>$notice) {
@@ -2819,7 +2819,7 @@ class Notice extends Managed_DataObject
                return array_values($map);
        }
 
-       static function getProfiles(&$notices)
+       static function getProfiles(array &$notices)
        {
                $ids = array();
                foreach ($notices as $notice) {
@@ -2829,7 +2829,7 @@ class Notice extends Managed_DataObject
                return Profile::pivotGet('id', $ids);
        }
 
-       static function fillGroups(&$notices)
+       static function fillGroups(array &$notices)
        {
         $ids = self::_idsOf($notices);
         $gis = Group_inbox::listGet('notice_id', $ids);
@@ -2864,7 +2864,7 @@ class Notice extends Managed_DataObject
                return array_keys($ids);
     }
 
-    static function fillAttachments(&$notices)
+    static function fillAttachments(array &$notices)
     {
         $ids = self::_idsOf($notices);
         $f2pMap = File_to_post::listGet('post_id', $ids);
@@ -2888,7 +2888,7 @@ class Notice extends Managed_DataObject
                }
     }
 
-    static function fillReplies(&$notices)
+    static function fillReplies(array &$notices)
     {
         $ids = self::_idsOf($notices);
         $replyMap = Reply::listGet('notice_id', $ids);