PasswordController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A update() 0 12 1
1
<?php
2
3
namespace App\Http\Controllers\Auth;
4
5
use App\Http\Controllers\Controller;
6
use Illuminate\Http\RedirectResponse;
7
use Illuminate\Http\Request;
8
use Illuminate\Support\Facades\Hash;
9
use Illuminate\Validation\Rules\Password;
10
11
class PasswordController extends Controller
12
{
13
    /**
14
     * Update the user's password.
15
     */
16
    public function update(Request $request): RedirectResponse
17
    {
18
        $validated = $request->validate([
0 ignored issues
show
Bug introduced by
The method validate() does not exist on Illuminate\Http\Request. ( Ignorable by Annotation )

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

18
        /** @scrutinizer ignore-call */ 
19
        $validated = $request->validate([

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
            'current_password' => ['required', 'current_password'],
20
            'password' => ['required', Password::defaults(), 'confirmed'],
21
        ]);
22
23
        $request->user()->update([
0 ignored issues
show
Bug introduced by
The method user() does not exist on Illuminate\Http\Request. ( Ignorable by Annotation )

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

23
        $request->/** @scrutinizer ignore-call */ 
24
                  user()->update([

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
24
            'password' => Hash::make($validated['password']),
25
        ]);
26
27
        return back();
28
    }
29
}
30