Skip to content

Commit

Permalink
Apply fixes from StyleCI (#16)
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
sampoyigi and StyleCIBot authored May 4, 2022
1 parent ce5e106 commit 78c0701
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function configureRateLimiting()
$params->maxAttempts = 6;
$params->decayMinutes = 1;

return TRUE;
return true;
}
});
}
Expand Down
22 changes: 11 additions & 11 deletions components/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function prepareVars()
$this->page['reviewsPage'] = $this->property('reviewsPage');
$this->page['inboxPage'] = $this->property('inboxPage');
$this->page['requireRegistrationTerms'] = (bool)$this->property('agreeRegistrationTermsPage');
$this->page['canRegister'] = (bool)setting('allow_registration', TRUE);
$this->page['canRegister'] = (bool)setting('allow_registration', true);

$this->page['customer'] = $this->customer();
}
Expand Down Expand Up @@ -179,12 +179,12 @@ public function onLogin()

Event::fire('igniter.user.beforeAuthenticate', [$this, $credentials]);

if (!Auth::authenticate($credentials, $remember, TRUE))
if (!Auth::authenticate($credentials, $remember, true))
throw new ApplicationException(lang('igniter.user::default.login.alert_invalid_login'));

session()->regenerate();

Event::fire('igniter.user.login', [$this], TRUE);
Event::fire('igniter.user.login', [$this], true);

if ($redirect = input('redirect'))
return Redirect::to($this->controller->pageUrl($redirect));
Expand All @@ -200,7 +200,7 @@ public function onLogin()
public function onRegister()
{
try {
if (!(bool)setting('allow_registration', TRUE))
if (!(bool)setting('allow_registration', true))
throw new ApplicationException(lang('igniter.user::default.login.alert_registration_disabled'));

$data = post();
Expand All @@ -222,7 +222,7 @@ public function onRegister()

Event::fire('igniter.user.beforeRegister', [&$data]);

$data['status'] = TRUE;
$data['status'] = true;

$customerGroup = Customer_groups_model::getDefault();
$data['customer_group_id'] = $customerGroup->getKey();
Expand Down Expand Up @@ -285,10 +285,10 @@ public function onUpdate()

$this->validate($data, $rules);

$passwordChanged = FALSE;
$passwordChanged = false;
if (strlen(post('old_password')) && strlen(post('new_password'))) {
$data['password'] = post('new_password');
$passwordChanged = TRUE;
$passwordChanged = true;
}

if (!array_key_exists('newsletter', $data))
Expand All @@ -298,7 +298,7 @@ public function onUpdate()
$customer->save();

if ($passwordChanged) {
Auth::login($customer, TRUE);
Auth::login($customer, true);
}

flash()->success(lang('igniter.user::default.settings.alert_updated_success'));
Expand Down Expand Up @@ -377,14 +377,14 @@ protected function sendRegistrationEmail($customer)
protected function passwordDoesNotMatch()
{
if (!strlen($password = post('old_password')))
return FALSE;
return false;

$credentials = ['password' => $password];
if (!Auth::validateCredentials($this->customer(), $credentials)) {
return 'Password does not match';
}

return FALSE;
return false;
}

protected function sendActivationEmail($customer)
Expand All @@ -411,7 +411,7 @@ protected function makeActivationUrl($code)
? $this->controller->pageUrl($pageName, $params)
: $this->controller->currentPageUrl($params);

if (strpos($url, $code) === FALSE) {
if (strpos($url, $code) === false) {
$url .= '?activate='.$code;
}

Expand Down
2 changes: 1 addition & 1 deletion components/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected function makeResetUrl($code)
$url = $this->currentPageUrl($params);
}

if (strpos($url, $code) === FALSE) {
if (strpos($url, $code) === false) {
$url .= '?reset='.$code;
}

Expand Down
6 changes: 3 additions & 3 deletions components/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ protected function checkSecurity()
$allowedGroup = $this->property('security', 'all');
$isAuthenticated = Auth::check();
if ($allowedGroup == 'customer' && !$isAuthenticated) {
return FALSE;
return false;
}

if ($allowedGroup == 'guest' && $isAuthenticated) {
return FALSE;
return false;
}

return TRUE;
return true;
}
}
2 changes: 1 addition & 1 deletion middleware/ThrottleRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes

protected function shouldThrottleRequest($request, $params)
{
return Event::fire('igniter.user.beforeThrottleRequest', [$request, $params], TRUE);
return Event::fire('igniter.user.beforeThrottleRequest', [$request, $params], true);
}
}

0 comments on commit 78c0701

Please sign in to comment.