mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 16:40:10 +00:00
Fix code quality with rector [skip ci]
This commit is contained in:
@@ -70,7 +70,7 @@ class CreateController extends Controller
|
||||
*
|
||||
* @return Factory|Redirector|RedirectResponse|View
|
||||
*/
|
||||
public function create(Request $request)
|
||||
public function create(Request $request): Redirector|RedirectResponse|Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
@@ -91,7 +91,7 @@ class CreateController extends Controller
|
||||
|
||||
Log::channel('audit')->info('Create new currency.');
|
||||
|
||||
return view('currencies.create', compact('subTitleIcon', 'subTitle'));
|
||||
return view('currencies.create', ['subTitleIcon' => $subTitleIcon, 'subTitle' => $subTitle]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +105,7 @@ class CreateController extends Controller
|
||||
$user = auth()->user();
|
||||
$data = $request->getCurrencyData();
|
||||
if (!$this->userRepository->hasRole($user, 'owner')) {
|
||||
app('log')->error('User '.auth()->user()->id.' is not admin, but tried to store a currency.');
|
||||
Log::error('User '.auth()->user()->id.' is not admin, but tried to store a currency.');
|
||||
Log::channel('audit')->warning('Tried to create (POST) currency without admin rights.', $data);
|
||||
|
||||
return redirect($this->getPreviousUrl('currencies.create.url'))->withInput();
|
||||
@@ -116,7 +116,7 @@ class CreateController extends Controller
|
||||
try {
|
||||
$currency = $this->repository->store($data);
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->error($e->getMessage());
|
||||
Log::error($e->getMessage());
|
||||
Log::channel('audit')->warning('Could not store (POST) currency without admin rights.', $data);
|
||||
$request->session()->flash('error', (string) trans('firefly.could_not_store_currency'));
|
||||
$currency = null;
|
||||
|
||||
Reference in New Issue
Block a user