]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Typing and static declaration in PoCo class
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Oct 2013 01:48:41 +0000 (03:48 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Oct 2013 01:48:41 +0000 (03:48 +0200)
lib/activityobject.php
lib/poco.php

index a4fa62fb96a21979a314fc63ea5949ab9a97e67c..aa9eb1837b2bcef725007af77eaf0024176a5a29 100644 (file)
@@ -505,7 +505,7 @@ class ActivityObject
         return $object;
     }
 
-    static function fromGroup($group)
+    static function fromGroup(User_group $group)
     {
         $object = new ActivityObject();
 
index baea5b33b03f79701bf253cc144da530c65445b9..2bc9e7276244117e0040a5a85074d3ce8b6aff85 100644 (file)
@@ -137,12 +137,8 @@ class PoCo
         return null;
     }
 
-    function fromProfile($profile)
+    static function fromProfile(Profile $profile)
     {
-        if (empty($profile)) {
-            return null;
-        }
-
         $poco = new PoCo();
 
         $poco->preferredUsername = $profile->nickname;
@@ -168,12 +164,8 @@ class PoCo
         return $poco;
     }
 
-    function fromGroup($group)
+    static function fromGroup(User_group $group)
     {
-        if (empty($group)) {
-            return null;
-        }
-
         $poco = new PoCo();
 
         $poco->preferredUsername = $group->nickname;