mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 01:32:25 +01:00
Use explicit exit
statement instead of return
This commit is contained in:
parent
31217514f6
commit
61923a7912
@ -80,7 +80,7 @@ class Admin
|
||||
}
|
||||
|
||||
if ($this->users->isEmpty()) {
|
||||
return $this->registerAdmin();
|
||||
$this->registerAdmin();
|
||||
}
|
||||
|
||||
if (!$this->isLoggedIn() && HTTPRequest::uri() !== '/login/') {
|
||||
@ -139,6 +139,7 @@ class Admin
|
||||
}
|
||||
$controller = new Controllers\Register();
|
||||
$controller->register();
|
||||
exit;
|
||||
}
|
||||
|
||||
protected function loadRoutes()
|
||||
|
@ -22,7 +22,6 @@ class Authentication extends AbstractController
|
||||
if ($limiter->hasReachedLimit()) {
|
||||
$minutes = round($this->option('admin.login_reset_time') / 60);
|
||||
$this->error($this->label('login.attempt.too-many', $minutes));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (HTTPRequest::method()) {
|
||||
@ -47,7 +46,7 @@ class Authentication extends AbstractController
|
||||
$data = new DataGetter(HTTPRequest::postData());
|
||||
|
||||
if (!$data->has(array('username', 'password'))) {
|
||||
return $this->error();
|
||||
$this->error();
|
||||
}
|
||||
|
||||
$limiter->registerAttempt();
|
||||
@ -98,5 +97,6 @@ class Authentication extends AbstractController
|
||||
$defaults = array('title' => $this->label('login.login'));
|
||||
$this->notify($message, 'error');
|
||||
$this->view('authentication.login', array_merge($defaults, $data));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -43,5 +43,6 @@ class Errors extends AbstractController
|
||||
'description' => $this->label('errors.error.' . $name . '.description'),
|
||||
'action' => $action
|
||||
));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ class Pages extends AbstractController
|
||||
$from = max(0, $data->get('from'));
|
||||
$to = max(0, $data->get('to'));
|
||||
if ($to === $from) {
|
||||
return;
|
||||
exit;
|
||||
}
|
||||
|
||||
array_splice($pages, $to, 0, array_splice($pages, $from, 1));
|
||||
|
@ -21,6 +21,7 @@ class Errors
|
||||
Header::status($status);
|
||||
$message = Header::$statuses[$status];
|
||||
require FORMWORK_PATH . 'error.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function exceptionHandler($exception)
|
||||
|
@ -102,7 +102,7 @@ class Formwork
|
||||
{
|
||||
if ($this->option('cache.enabled') && $data = $this->cache->fetch($this->cacheKey)) {
|
||||
echo $data;
|
||||
return;
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->router->add(array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user