Completed
Pull Request — devel (#146)
by Litera
24:35 queued 19:02
created

PersonEntity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 46
loc 46
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 4 4 1
A toArray() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace App\Entities;
4
5 View Code Duplication
class PersonEntity implements IEntity
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
The property $postal_code is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $created_at is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $updated_at is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $deleted_at is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
6
{
7
8
	public $id;
9
10
	public $guid;
11
12
	public $name;
13
14
	public $surname;
15
16
	public $nick;
17
18
	public $birthday;
19
20
	public $email;
21
22
	public $street;
23
24
	public $city;
25
26
	public $postal_code;
27
28
	public $created_at;
29
30
	public $updated_at;
31
32
	public $deleted_at;
33
34
	/**
35
	 * @return int
36
	 */
37
	public function getId()
38
	{
39
		return $this->id;
40
	}
41
42
	/**
43
	 * @return array
44
	 */
45
	public function toArray()
46
	{
47
		return get_object_vars($this);
48
	}
49
50
}
51