From 15d8f97fd97cc8c0290f124b9485bec5e52a82fb 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 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) { -- 2.39.5