]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/userbyid.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / actions / userbyid.php
index 86a61f20b301015b20fdd451bf4fc9296d97d503..27b6b7bb5b684084b693dd750ec1fa198eb02aad 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * User by ID action class.
  *
@@ -47,30 +46,32 @@ class UserbyidAction extends Action
 {
      /**
      * Is read only?
-     * 
+     *
      * @return boolean true
      */
-    function isReadOnly($args)
-    {                
+    function isReadOnly(array $args=array())
+    {
         return true;
     }
 
      /**
      * Class handler.
-     * 
+     *
      * @param array $args array of arguments
      *
      * @return nothing
      */
-    function handle($args)
+    protected function handle()
     {
-        parent::handle($args);
+        parent::handle();
         $id = $this->trimmed('id');
         if (!$id) {
-            $this->clientError(_('No id.'));
+            // TRANS: Client error displayed trying to find a user by ID without providing an ID.
+            $this->clientError(_('No ID.'));
         }
-        $user =& User::staticGet($id);
+        $user = User::getKV($id);
         if (!$user) {
+            // TRANS: Client error displayed trying to find a user by ID for a non-existing ID.
             $this->clientError(_('No such user.'));
         }
 
@@ -88,4 +89,3 @@ class UserbyidAction extends Action
         common_redirect($url, 303);
     }
 }
-