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=e210b5187dc7837727330138ed4009a1999d9e4d;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 64087cf312..98582bb357 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -203,20 +203,19 @@ abstract 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', @@ -234,7 +233,7 @@ abstract 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 2ddfefa9c2..9f6077594b 100644 --- a/plugins/SubMirror/SubMirrorPlugin.php +++ b/plugins/SubMirror/SubMirrorPlugin.php @@ -157,7 +157,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) {