summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-10-28 14:21:42 -0400
committerEvan Prodromou <evan@status.net>2009-10-28 14:21:42 -0400
commit7df082abb8f9570e55bac209068146e34b3781b4 (patch)
treee525b1525aa73fdf639ca3ff393df010f4e858f9 /classes
parent6d6de3c1c7b359815aa0381b4cde3fcc8258cc80 (diff)
replace some boolean-evaluations with calls to empty()
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index cd3906ca1..44eded8e8 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -172,7 +172,7 @@ class Notice extends Memcached_DataObject
throw new ClientException(_('Problem saving notice. Too long.'));
}
- if (!$profile) {
+ if (empty($profile)) {
throw new ClientException(_('Problem saving notice. Unknown user.'));
}
@@ -307,11 +307,11 @@ class Notice extends Memcached_DataObject
static function checkDupes($profile_id, $content) {
$profile = Profile::staticGet($profile_id);
- if (!$profile) {
+ if (empty($profile)) {
return false;
}
$notice = $profile->getNotices(0, NOTICE_CACHE_WINDOW);
- if ($notice) {
+ if (!empty($notice)) {
$last = 0;
while ($notice->fetch()) {
if (time() - strtotime($notice->created) >= common_config('site', 'dupelimit')) {
@@ -337,7 +337,7 @@ class Notice extends Memcached_DataObject
static function checkEditThrottle($profile_id) {
$profile = Profile::staticGet($profile_id);
- if (!$profile) {
+ if (empty($profile)) {
return false;
}
# Get the Nth notice
@@ -658,7 +658,7 @@ class Notice extends Memcached_DataObject
$cache = common_memcache();
- if (!$cache) {
+ if (empty($cache)) {
return Notice::getStreamDirect($qry, $offset, $limit, null, null, $order, null);
}
@@ -719,7 +719,7 @@ class Notice extends Memcached_DataObject
# If there are no hits, just return the value
- if (!$notice) {
+ if (empty($notice)) {
return $notice;
}
@@ -1061,12 +1061,12 @@ class Notice extends Memcached_DataObject
for ($i=0; $i<count($names); $i++) {
$nickname = $names[$i];
$recipient = common_relative_profile($sender, $nickname, $this->created);
- if (!$recipient) {
+ if (empty($recipient)) {
continue;
}
// Don't save replies from blocked profile to local user
$recipient_user = User::staticGet('id', $recipient->id);
- if ($recipient_user && $recipient_user->hasBlocked($sender)) {
+ if (!empty($recipient_user) && $recipient_user->hasBlocked($sender)) {
continue;
}
$reply = new Reply();