Completed
Push — master ( f1984f...37c291 )
by Hector
17s queued 11s
created

PromotedAccount   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 102
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 102
loc 102
rs 10
c 0
b 0
f 0
wmc 10
lcom 0
cbo 1

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 4 4 1
A getApprovalStatus() 4 4 1
A getCreatedAt() 4 4 1
A getUpdatedAt() 4 4 1
A getDeleted() 4 4 1
A getLineItemId() 4 4 1
A setLineItemId() 4 4 1
A getUserId() 4 4 1
A setUserId() 4 4 1
A setProperties() 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 Hborras\TwitterAdsSDK\TwitterAds\Creative;
4
5
use Hborras\TwitterAdsSDK\TwitterAds\Resource;
6
use Hborras\TwitterAdsSDK\TwitterAds\Fields\PromotedAccountFields;
7
8
/**
9
 * Class PromotedAccount
10
 * @package Hborras\TwitterAdsSDK\TwitterAds\Creative
11
 */
12 View Code Duplication
class PromotedAccount extends Resource
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
    const RESOURCE_COLLECTION = 'accounts/{account_id}/promoted_accounts';
15
    const RESOURCE            = 'accounts/{account_id}/promoted_accounts/{id}';
16
    const RESOURCE_STATS      = 'stats/accounts/{account_id}/promoted_accounts/{id}';
17
18
    /** Read Only */
19
    protected $id;
20
    protected $approval_status;
21
    protected $created_at;
22
    protected $updated_at;
23
    protected $deleted;
24
25
    protected $properties = [
26
        PromotedAccountFields::LINE_ITEM_ID,
27
        PromotedAccountFields::USER_ID,
28
    ];
29
30
    /** Writable */
31
    protected $line_item_id;
32
    protected $user_id;
33
34
    /**
35
     * @return mixed
36
     */
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    /**
43
     * @return mixed
44
     */
45
    public function getApprovalStatus()
46
    {
47
        return $this->approval_status;
48
    }
49
50
    /**
51
     * @return mixed
52
     */
53
    public function getCreatedAt()
54
    {
55
        return $this->created_at;
56
    }
57
58
    /**
59
     * @return mixed
60
     */
61
    public function getUpdatedAt()
62
    {
63
        return $this->updated_at;
64
    }
65
66
    /**
67
     * @return mixed
68
     */
69
    public function getDeleted()
70
    {
71
        return $this->deleted;
72
    }
73
74
    /**
75
     * @return mixed
76
     */
77
    public function getLineItemId()
78
    {
79
        return $this->line_item_id;
80
    }
81
82
    /**
83
     * @param mixed $line_item_id
84
     */
85
    public function setLineItemId($line_item_id)
86
    {
87
        $this->line_item_id = $line_item_id;
88
    }
89
90
    /**
91
     * @return mixed
92
     */
93
    public function getUserId()
94
    {
95
        return $this->user_id;
96
    }
97
98
    /**
99
     * @param mixed $user_id
100
     */
101
    public function setUserId($user_id)
102
    {
103
        $this->user_id = $user_id;
104
    }
105
106
    /**
107
     * @param array $properties
108
     */
109
    public function setProperties($properties)
110
    {
111
        $this->properties = $properties;
112
    }
113
}
114