Passed
Push — develop ( 501901...142042 )
by Septianata
14:25
created

Attribute   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A setPasswordAttribute() 0 5 1
1
<?php
2
3
namespace App\Models\Concerns\User;
4
5
use Illuminate\Support\Facades\Hash;
6
7
/**
8
 * @property string $username
9
 * @property string $fullname
10
 * @property string $email
11
 * @property string $phone_country
12
 * @property \Propaganistas\LaravelPhone\PhoneNumber|null $phone
13
 * @property \Illuminate\Support\Carbon $email_verified_at
14
 * @property string $password
15
 * @property string $remember_token
16
 *
17
 * @see \App\Models\User
18
 */
19
trait Attribute
20
{
21
    /**
22
     * Set "password" attribute value.
23
     *
24
     * @param  mixed  $value
25
     * @return void
26
     */
27
    public function setPasswordAttribute($value)
28
    {
29
        $this->attributes['password'] = Hash::make($value);
0 ignored issues
show
Bug Best Practice introduced by
The property attributes does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
30
31
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type App\Models\Concerns\User\Attribute which is incompatible with the documented return type void.
Loading history...
32
    }
33
}
34