mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* RegisterController.php
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
@@ -80,7 +81,7 @@ class RegisterController extends Controller
|
||||
/**
|
||||
* Handle a registration request for the application.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Application|Redirector|RedirectResponse
|
||||
* @throws FireflyException
|
||||
@@ -89,7 +90,7 @@ class RegisterController extends Controller
|
||||
public function register(Request $request)
|
||||
{
|
||||
$allowRegistration = $this->allowedToRegister();
|
||||
$inviteCode = (string) $request->get('invite_code');
|
||||
$inviteCode = (string)$request->get('invite_code');
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
$validCode = $repository->validateInviteCode($inviteCode);
|
||||
|
||||
@@ -105,7 +106,7 @@ class RegisterController extends Controller
|
||||
|
||||
$this->guard()->login($user);
|
||||
|
||||
session()->flash('success', (string) trans('firefly.registered'));
|
||||
session()->flash('success', (string)trans('firefly.registered'));
|
||||
|
||||
$this->registered($request, $user);
|
||||
|
||||
@@ -140,37 +141,10 @@ class RegisterController extends Controller
|
||||
return $allowRegistration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application registration form.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function showRegistrationForm(Request $request)
|
||||
{
|
||||
$isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$pageTitle = (string) trans('firefly.register_page_title');
|
||||
$allowRegistration = $this->allowedToRegister();
|
||||
|
||||
if (false === $allowRegistration) {
|
||||
$message = 'Registration is currently not available. If you are the administrator, you can enable this in the administration.';
|
||||
|
||||
return view('error', compact('message'));
|
||||
}
|
||||
|
||||
$email = $request->old('email');
|
||||
|
||||
return view('auth.register', compact('isDemoSite', 'email', 'pageTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application registration form if the invitation code is valid.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws ContainerExceptionInterface
|
||||
@@ -180,7 +154,7 @@ class RegisterController extends Controller
|
||||
public function showInviteForm(Request $request, string $code)
|
||||
{
|
||||
$isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$pageTitle = (string) trans('firefly.register_page_title');
|
||||
$pageTitle = (string)trans('firefly.register_page_title');
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
$allowRegistration = $this->allowedToRegister();
|
||||
$inviteCode = $code;
|
||||
@@ -201,4 +175,31 @@ class RegisterController extends Controller
|
||||
|
||||
return view('auth.register', compact('isDemoSite', 'email', 'pageTitle', 'inviteCode'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application registration form.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function showRegistrationForm(Request $request)
|
||||
{
|
||||
$isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$pageTitle = (string)trans('firefly.register_page_title');
|
||||
$allowRegistration = $this->allowedToRegister();
|
||||
|
||||
if (false === $allowRegistration) {
|
||||
$message = 'Registration is currently not available. If you are the administrator, you can enable this in the administration.';
|
||||
|
||||
return view('error', compact('message'));
|
||||
}
|
||||
|
||||
$email = $request->old('email');
|
||||
|
||||
return view('auth.register', compact('isDemoSite', 'email', 'pageTitle'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user