aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggUser.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2013-03-15 11:18:05 -0400
committercash <cash.costello@gmail.com>2013-03-15 11:18:05 -0400
commita2ecf54d56d9f877e6f0f8ac6d841cee6187aac4 (patch)
treeccd5b6029d3f77cc09144132d12fbd2c2e2b0fa4 /engine/classes/ElggUser.php
parent4cd8bc8d68008f509ce97b2e31e1e5ccfec7bdf0 (diff)
downloadelgg-a2ecf54d56d9f877e6f0f8ac6d841cee6187aac4.tar.gz
elgg-a2ecf54d56d9f877e6f0f8ac6d841cee6187aac4.tar.bz2
more coding standard fixes
Diffstat (limited to 'engine/classes/ElggUser.php')
-rw-r--r--engine/classes/ElggUser.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index 6c1cdc1de..b80065b27 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -65,30 +65,26 @@ class ElggUser extends ElggEntity
$msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));
throw new IOException($msg);
}
-
- // See if this is a username
} else if (is_string($guid)) {
+ // $guid is a username
$user = get_user_by_username($guid);
if ($user) {
foreach ($user->attributes as $key => $value) {
$this->attributes[$key] = $value;
}
}
-
- // Is $guid is an ElggUser? Use a copy constructor
} else if ($guid instanceof ElggUser) {
+ // $guid is an ElggUser so this is a copy constructor
elgg_deprecated_notice('This type of usage of the ElggUser constructor was deprecated. Please use the clone method.', 1.7);
foreach ($guid->attributes as $key => $value) {
$this->attributes[$key] = $value;
}
-
- // Is this is an ElggEntity but not an ElggUser = ERROR!
} else if ($guid instanceof ElggEntity) {
+ // @todo why have a special case here
throw new InvalidParameterException(elgg_echo('InvalidParameterException:NonElggUser'));
-
- // Is it a GUID
} else if (is_numeric($guid)) {
+ // $guid is a GUID so load entity
if (!$this->load($guid)) {
throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));
}