Code Duplication    Length = 52-70 lines in 3 locations

src/Dropbox/Models/FileRequestDeadline.php 1 location

@@ 4-55 (lines=52) @@
1
<?php
2
namespace Dropbox\Models;
3
4
class FileRequestDeadline extends BaseModel
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

src/Dropbox/Models/FileSharingInfo.php 1 location

@@ 4-71 (lines=68) @@
1
<?php
2
namespace Dropbox\Models;
3
4
class FileSharingInfo extends BaseModel
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
    public function __construct(array $data)
35
    {
36
        parent::__construct($data);
37
        $this->read_only = $this->getDataProperty('read_only');
38
        $this->modified_by = $this->getDataProperty('modified_by');
39
        $this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id');
40
    }
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

src/Dropbox/Models/FolderSharingInfo.php 1 location

@@ 4-73 (lines=70) @@
1
<?php
2
namespace Dropbox\Models;
3
4
class FolderSharingInfo extends BaseModel
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 folder.
16
     * Set if the folder is contained by a shared folder.
17
     *
18
     * @var string
19
     */
20
    protected $parent_shared_folder_id;
21
22
    /**
23
     * If this folder is a shared folder mount point,
24
     * the ID of the shared folder mounted at this location.
25
     *
26
     * @var string
27
     */
28
    protected $shared_folder_id;
29
30
31
    /**
32
     * Create a new Folder Sharing Info instance
33
     *
34
     * @param array $data
35
     */
36
    public function __construct(array $data)
37
    {
38
        parent::__construct($data);
39
        $this->read_only = $this->getDataProperty('read_only');
40
        $this->shared_folder_id = $this->getDataProperty('shared_folder_id');
41
        $this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id');
42
    }
43
44
    /**
45
     * True if the folder or folder is inside a read-only shared folder.
46
     *
47
     * @return bool
48
     */
49
    public function isReadOnly()
50
    {
51
        return $this->read_only;
52
    }
53
54
    /**
55
     * ID of shared folder that holds this folder.
56
     *
57
     * @return string
58
     */
59
    public function getParentSharedFolderId()
60
    {
61
        return $this->parent_shared_folder_id;
62
    }
63
64
    /**
65
     * ID of shared folder.
66
     *
67
     * @return string
68
     */
69
    public function getSharedFolderId()
70
    {
71
        return $this->shared_folder_id;
72
    }
73
}
74