Cosmetic changes to common_redirect, clientError, serverError

Since these functions exit (or throw exception) after running, there
is no need to have a 'return' statement or similar afterwards.
This commit is contained in:
Mikael Nordfeldth
2014-03-10 00:19:35 +01:00
parent acbe94936f
commit c00491cd7a
132 changed files with 20 additions and 472 deletions

View File

@@ -58,7 +58,6 @@ class AnonDisfavorAction extends RedirectingAction
// TRANS: Client error.
_m('Could not disfavor notice! Please make sure your browser has cookies enabled.')
);
return;
}
$id = $this->trimmed('notice');
@@ -79,7 +78,6 @@ class AnonDisfavorAction extends RedirectingAction
common_log_db_error($fave, 'DELETE', __FILE__);
// TRANS: Server error.
$this->serverError(_m('Could not delete favorite.'));
return;
}
$profile->blowFavesCache();

View File

@@ -55,9 +55,7 @@ class AnonFavorAction extends RedirectingAction
if (empty($profile) || $_SERVER['REQUEST_METHOD'] != 'POST') {
// TRANS: Client error.
$this->clientError(_m('Could not favor notice! Please make sure your browser has cookies enabled.')
);
return;
$this->clientError(_m('Could not favor notice! Please make sure your browser has cookies enabled.'));
}
$id = $this->trimmed('notice');
@@ -67,14 +65,12 @@ class AnonFavorAction extends RedirectingAction
if ($profile->hasFave($notice)) {
// TRANS: Client error.
$this->clientError(_m('This notice is already a favorite!'));
return;
}
$fave = Fave::addNew($profile, $notice);
if (!$fave) {
// TRANS: Server error.
$this->serverError(_m('Could not create favorite.'));
return;
}
$profile->blowFavesCache();