| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanesoft\Auth\Http\Requests\Admin\Users; |
||
| 30 | public function rules() |
||
| 31 | { |
||
| 32 | /** @var \Arcanesoft\Contracts\Auth\Models\User $user */ |
||
| 33 | $user = $this->route('auth_user'); |
||
| 34 | |||
| 35 | return array_merge(parent::rules(), [ |
||
| 36 | 'username' => "required|min:3|unique:users,username,{$user->id}", |
||
|
|
|||
| 37 | 'email' => "required|email|unique:users,email,{$user->id}", |
||
| 38 | 'password' => 'required_with:password_confirmation|min:8|confirmed', |
||
| 39 | 'password_confirmation' => 'required_with:password', |
||
| 40 | ]); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: