]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Save some memory + added type-hint.
authorRoland Haeder <roland@mxchange.org>
Fri, 27 Mar 2015 21:22:08 +0000 (22:22 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 27 Mar 2015 21:22:08 +0000 (22:22 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/profileaction.php
plugins/SubMirror/SubMirrorPlugin.php

index 79008f3bfcb2397d6b13fdba0448732fc243a39d..2ec94da8181551d270035caab6e9391e37b272cc 100644 (file)
@@ -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);
index 13a8a9fd71633151a8dad946602fc675c927cc1e..60560b4afc5bc4cef2d62174736ede7f382e0e7a 100644 (file)
@@ -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) {