Share   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
c 1
b 0
f 0
dl 0
loc 57
ccs 8
cts 8
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFoldersAttribute() 0 3 1
A team() 0 3 1
A getListsAttribute() 0 3 1
A getTasksAttribute() 0 3 1
1
<?php
2
3
namespace Spinen\ClickUp;
4
5
use Spinen\ClickUp\Exceptions\InvalidRelationshipException;
6
use Spinen\ClickUp\Exceptions\ModelNotFoundException;
7
use Spinen\ClickUp\Exceptions\NoClientException;
8
use Spinen\ClickUp\Support\Collection;
9
use Spinen\ClickUp\Support\Model;
10
use Spinen\ClickUp\Support\Relations\ChildOf;
11
12
/**
13
 * Class Share
14
 *
15
 * @package Spinen\ClickUp
16
 *
17
 * @property Collection $folders
18
 * @property Collection $lists
19
 * @property Collection $tasks
20
 * @property Team $team
21
 */
22
class Share extends Model
23
{
24
    /**
25
     * Path to API endpoint.
26
     *
27
     * @var string
28
     */
29
    protected $path = '/share';
30
31
    /**
32
     * Accessor for Folders.
33
     *
34
     * @param array $folders
35
     *
36
     * @return Collection
37
     * @throws NoClientException
38
     */
39 1
    public function getFoldersAttribute(array $folders): Collection
40
    {
41 1
        return $this->givenMany(Folder::class, $folders);
42
    }
43
44
    /**
45
     * Accessor for Lists.
46
     *
47
     * @param array $lists
48
     *
49
     * @return Collection
50
     * @throws NoClientException
51
     */
52 1
    public function getListsAttribute(array $lists): Collection
53
    {
54 1
        return $this->givenMany(TaskList::class, $lists);
55
    }
56
57
    /**
58
     * Accessor for Tasks.
59
     *
60
     * @param array $tasks
61
     *
62
     * @return Collection
63
     * @throws NoClientException
64
     */
65 1
    public function getTasksAttribute(array $tasks): Collection
66
    {
67 1
        return $this->givenMany(Task::class, $tasks);
68
    }
69
70
    /**
71
     * @return ChildOf
72
     * @throws InvalidRelationshipException
73
     * @throws ModelNotFoundException
74
     * @throws NoClientException
75
     */
76 1
    public function team(): ChildOf
77
    {
78 1
        return $this->childOf(Team::class);
79
    }
80
}
81