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

FileSharingInfo::getParentSharedFolderId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
namespace Dropbox\Models;
3
4 View Code Duplication
class FileSharingInfo 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
     * True if the file or folder is inside a read-only shared folder.
9
     *
10
     * @var bool
11
     */
12
    protected $read_only;
13
14
    /**
15
     * ID of shared folder that holds this file.
16
     *
17
     * @var string
18
     */
19
    protected $parent_shared_folder_id;
20
21
    /**
22
     * The last user who modified the file.
23
     * This field will be null if the user's account has been deleted.
24
     *
25
     * @var string
26
     */
27
    protected $modified_by;
28
29
    /**
30
     * Create a new File Sharing Info instance
31
     *
32
     * @param array $data
33
     */
34 3
    public function __construct(array $data)
35
    {
36 3
        parent::__construct($data);
37 3
        $this->read_only = $this->getDataProperty('read_only');
38 3
        $this->modified_by = $this->getDataProperty('modified_by');
39 3
        $this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id');
40 3
    }
41
42
    /**
43
     * True if the file or folder is inside a read-only shared folder.
44
     *
45
     * @return bool
46
     */
47
    public function isReadOnly()
48
    {
49
        return $this->read_only;
50
    }
51
52
    /**
53
     * ID of shared folder that holds this file.
54
     *
55
     * @return string
56
     */
57
    public function getParentSharedFolderId()
58
    {
59
        return $this->parent_shared_folder_id;
60
    }
61
62
    /**
63
     * Get the last user who modified the file.
64
     *
65
     * @return string
66
     */
67
    public function getModifiedBy()
68
    {
69
        return $this->modified_by;
70
    }
71
}
72