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

FileRequestDeadline::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 9
loc 9
ccs 0
cts 9
cp 0
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
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