Contact
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 39
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 0
lcom 0
cbo 3
dl 39
loc 39
c 0
b 0
f 0

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 linkprofit\AmoCRM\entities;
4
5
use linkprofit\AmoCRM\traits\CompanyLinkable;
6
use linkprofit\AmoCRM\traits\LeadsLinkable;
7
8
/**
9
 * Class Contact
10
 * @package linkprofit\AmoCRM\entities
11
 */
12 View Code Duplication
class Contact extends CustomizableEntity
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...
13
{
14
    /**
15
     * @var string Название контакта
16
     */
17
    public $name;
18
19
    /**
20
     * @var integer id пользователя создавшего контакт
21
     */
22
    public $created_by;
23
24
    /**
25
     * @var string Название новой компании. Параметр указывается для создания новой компании и привязке к ней контакта. Для привязки контакта к уже существующей компании, необходимо использовать параметр company_id
26
     */
27
    public $company_name;
28
29
    /**
30
     * @var string Теги, привязываемые к контакту. Задаются целостной строковой переменной, внутри строки перечисляются через запятую
31
     */
32
    public $tags;
33
34
    /**
35
     * @var string Покупатели, привязываемые к контакту. Перечисляются через запятую.
36
     */
37
    public $customers_id;
38
39
    use CompanyLinkable,
40
        LeadsLinkable;
41
42
    /**
43
     * @var array
44
     */
45
    protected $fieldList = [
46
        'id', 'name', 'created_at', 'updated_at',
47
        'responsible_user_id', 'created_by', 'company_name',
48
        'tags', 'leads_id', 'customers_id', 'company_id',
49
    ];
50
}