GeneralController::index()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers\Account;
4
5
use App\Http\Controllers\Controller;
6
use App\Http\Requests\Account\GeneralUpdateRequest;
7
8
class GeneralController extends Controller
9
{
10
    /**
11
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
12
     */
13
    public function index()
14
    {
15
        $account = auth()->user();
16
17
        return view('account.general', compact('account'));
18
    }
19
20
    /**
21
     * @param GeneralUpdateRequest $request
22
     * @return \Illuminate\Http\RedirectResponse
23
     */
24
    public function update(GeneralUpdateRequest $request)
25
    {
26
        $request->user()->update($request->all());
27
28
        notify()->flash(trans('general.woohoo'), 'success', [
0 ignored issues
show
Bug introduced by
It seems like trans('general.woohoo') can also be of type array; however, parameter $message of Codecourse\Notify\Notifier::flash() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

28
        notify()->flash(/** @scrutinizer ignore-type */ trans('general.woohoo'), 'success', [
Loading history...
29
            'timer' => 2000,
30
            'text' => trans('general.success.update'),
31
        ]);
32
33
        return redirect()->back();
34
    }
35
}
36