From: Roland Haeder Date: Tue, 10 Mar 2015 17:31:46 +0000 (+0100) Subject: Added checked type-hints X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4292cea3bcda7d69d72d1c3c3b0349b3a858f915;p=quix0rs-gnu-social.git Added checked type-hints Signed-off-by: Roland Haeder Conflicts: classes/Notice.php Signed-off-by: Roland Haeder --- diff --git a/classes/Notice.php b/classes/Notice.php index b519a0dba3..d3d4ef37a3 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1242,7 +1242,7 @@ class Notice extends Managed_DataObject * * @return void */ - function saveKnownUrls($urls) + function saveKnownUrls(array $urls) { if (common_config('attachments', 'process_links')) { // @fixme validation? @@ -1855,7 +1855,7 @@ class Notice extends Managed_DataObject return $this->_replies[$this->getID()]; } - function _setReplies($replies) + function _setReplies(array $replies) { $this->_replies[$this->getID()] = $replies; } @@ -1929,6 +1929,7 @@ class Notice extends Managed_DataObject protected $_groups = array(); + /// @TODO Mixture of tab-space ahead function getGroups() { // Don't save groups for repeats @@ -2843,7 +2844,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); @@ -2866,7 +2867,7 @@ class Notice extends Managed_DataObject return ($result == 1) ? true : false; } - protected function _inScope($profile) + protected function _inScope(Profile $profile=null) { $scope = is_null($this->scope) ? self::defaultScope() : $this->getScope(); @@ -2931,7 +2932,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. @@ -3016,7 +3017,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) { @@ -3033,7 +3034,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) { @@ -3043,7 +3044,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); @@ -3078,7 +3079,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); @@ -3115,7 +3116,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);