From e210b5187dc7837727330138ed4009a1999d9e4d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 27 Mar 2015 22:22:08 +0100 Subject: [PATCH] Save some memory + added type-hint. Signed-off-by: Roland Haeder --- lib/profileaction.php | 9 ++++----- plugins/SubMirror/SubMirrorPlugin.php | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) 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) { -- 2.39.5