GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d32316...bc6278 )
by Haven
02:32
created

User   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 1
dl 0
loc 67
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setPassword() 0 6 1
A setFirstName() 0 4 1
A getFirstName() 0 4 1
A setLastName() 0 4 1
A getLastName() 0 4 1
A setEmail() 0 4 1
A getEmailVariables() 0 7 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
*
9
*/
10
class User extends Model
11
{
12
13
	protected $table = 'users';
14
15
	public $first_name;
16
17
	public $last_name;
18
19
	public $email;
20
21
	protected $fillable = [
22
		'email',
23
		'name',
24
		'password',
25
	];
26
27
	public function setPassword($password)
28
	{
29
		$this->update([
30
			'password' => password_hash($password,PASSWORD_DEFAULT)
31
		]);
32
	}
33
34 1
	public function setFirstName($firstName)
35
	{
36 1
		$this->first_name = trim($firstName);
37 1
	}
38
39
	public function getFirstName()
40
	{
41
		return $this->first_name;
42
	}
43
44 1
	public function setLastName($lastName)
45
	{
46 1
		$this->last_name = trim($lastName);
47 1
	}
48
49
	public function getLastName()
50
	{
51
		return $this->last_name;
52
	}
53
54 1
	public function setEmail($email)
55
	{
56 1
		$this->email = $email;
57 1
	}
58
59 1
	public function getEmail()
60
	{
61 1
	    return $this->email;
62
	}
63
64 1
	public function getFullName()
65
	{
66 1
		return "$this->first_name $this->last_name";
67
	}
68
69 1
	public function getEmailVariables()
70
	{
71
	return [
72 1
		'full_name' => $this->getFullName(),
73 1
		'email' => $this->getEmail(),
74
	];
75
	}
76
}