]> 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 Häder <roland@mxchange.org>
Sun, 29 Mar 2020 22:21:00 +0000 (00:21 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/profileaction.php
plugins/SubMirror/SubMirrorPlugin.php

index 64087cf3126a60efc6c0f3050217020e192f94c7..98582bb357d3213a9f4c6ad91901ff87d07b69f8 100644 (file)
@@ -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);
index 2ddfefa9c20c7e7e9482d7a638f7328b05d118ae..9f6077594bc2461b3b19d8f9b69d634091a40524 100644 (file)
@@ -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) {