From: Roland Haeder Date: Fri, 27 Mar 2015 21:22:08 +0000 (+0100) Subject: Save some memory + added type-hint. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=15d8f97fd97cc8c0290f124b9485bec5e52a82fb;hp=26195d90e2a2544344a456e96cc69b9f07396207;p=quix0rs-gnu-social.git Save some memory + added type-hint. Signed-off-by: Roland Haeder --- diff --git a/lib/profileaction.php b/lib/profileaction.php index 79008f3bfc..2ec94da818 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -209,20 +209,19 @@ class ProfileAction extends ManagedAction // TRANS: H2 text for user statistics. $this->element('h2', null, _('Statistics')); - $profile = $this->target; - $actionParams = array('nickname' => $profile->nickname); + $actionParams = array('nickname' => $this->target->nickname); $stats = array( array( 'id' => 'user-id', // TRANS: Label for user statistics. 'label' => _('User ID'), - 'value' => $profile->id, + 'value' => $this->target->id, ), array( 'id' => 'member-since', // TRANS: Label for user statistics. 'label' => _('Member since'), - 'value' => date('j M Y', strtotime($profile->created)) + 'value' => date('j M Y', strtotime($this->target->created)) ), array( 'id' => 'notices', @@ -240,7 +239,7 @@ class ProfileAction extends ManagedAction ); // Give plugins a chance to add stats entries - Event::handle('ProfileStats', array($profile, &$stats)); + Event::handle('ProfileStats', array($this->target, &$stats)); foreach ($stats as $row) { $this->showStatsRow($row); diff --git a/plugins/SubMirror/SubMirrorPlugin.php b/plugins/SubMirror/SubMirrorPlugin.php index 13a8a9fd71..60560b4afc 100644 --- a/plugins/SubMirror/SubMirrorPlugin.php +++ b/plugins/SubMirror/SubMirrorPlugin.php @@ -155,7 +155,7 @@ class SubMirrorPlugin extends Plugin * @param array $stats * @return boolean hook return value */ - function onProfileStats($profile, &$stats) + function onProfileStats(Profile $profile, array &$stats) { $cur = common_current_user(); if (!empty($cur) && $cur->id == $profile->id) {