Completed
Push — master ( 2994aa...19d116 )
by Patrick
08:28
created

FileRequestDeadline   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 52
loc 52
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 9 9 2
A getDeadline() 4 4 1
A getAllowLateUploads() 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
namespace Dropbox\Models;
3
4 View Code Duplication
class FileRequestDeadline extends BaseModel
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...
5
{
6
7
    /**
8
     * The deadline.
9
     *
10
     * @var string
11
     */
12
    protected $deadline;
13
14
    /**
15
     * The grace period allowing late uploads after deadline reached.
16
     *
17
     * @var string
18
     */
19
    protected $allow_late_uploads;
20
21
    /**
22
     * Create a new FileRequestDeadline instance
23
     *
24
     * @param array $data
25
     */
26
    public function __construct(array $data)
27
    {
28
        parent::__construct($data);
29
        $this->deadline = $this->getDataProperty('deadline');
30
        $this->allow_late_uploads = $this->getDataProperty('allow_late_uploads');
31
        if (is_array($this->allow_late_uploads)) {
32
            $this->allow_late_uploads = $this->allow_late_uploads['.tag'];
33
        }
34
    }
35
36
    /**
37
     * Get the 'deadline' property of the file request deadline model.
38
     *
39
     * @return string
40
     */
41
    public function getDeadline()
42
    {
43
        return $this->deadline;
44
    }
45
46
    /**
47
     * Get the 'allow_late_uploads' property of the file request deadline model.
48
     *
49
     * @return string
50
     */
51
    public function getAllowLateUploads()
52
    {
53
        return $this->allow_late_uploads;
54
    }
55
}
56