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 ( 62baf5...06a1aa )
by Haven
03:01
created

User   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 1
dl 0
loc 66
ccs 16
cts 24
cp 0.6667
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
 * User
9
 *
10
 * @author    Haven Shen <[email protected]>
11
 * @copyright    Copyright (c) Haven Shen
12
 */
13
class User extends Model
14
{
15
	protected $table = 'users';
16
17
	public $first_name;
18
19
	public $last_name;
20
21
	public $email;
22
23
	protected $fillable = [
24
		'email',
25
		'name',
26
		'password',
27
	];
28
29
	public function setPassword($password)
30
	{
31
		$this->update([
32
			'password' => password_hash($password, PASSWORD_DEFAULT)
33
		]);
34
	}
35
36 1
	public function setFirstName($firstName)
37
	{
38 1
		$this->first_name = trim($firstName);
39 1
	}
40
41
	public function getFirstName()
42
	{
43
		return $this->first_name;
44
	}
45
46 1
	public function setLastName($lastName)
47
	{
48 1
		$this->last_name = trim($lastName);
49 1
	}
50
51
	public function getLastName()
52
	{
53
		return $this->last_name;
54
	}
55
56 1
	public function setEmail($email)
57
	{
58 1
		$this->email = $email;
59 1
	}
60
61 1
	public function getEmail()
62
	{
63 1
		return $this->email;
64
	}
65
66 1
	public function getFullName()
67
	{
68 1
		return "$this->first_name $this->last_name";
69
	}
70
71 1
	public function getEmailVariables()
72
	{
73
		return [
74 1
			'full_name' => $this->getFullName(),
75 1
			'email' => $this->getEmail(),
76
		];
77
	}
78
}