Total Complexity | 5 |
Total Lines | 75 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class Tasks |
||
13 | { |
||
14 | /** |
||
15 | * @var ClientInterface |
||
16 | */ |
||
17 | private $client; |
||
18 | |||
19 | /** |
||
20 | * @var TaskFactory |
||
21 | */ |
||
22 | private $factory; |
||
23 | |||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | private $roomId; |
||
28 | |||
29 | /** |
||
30 | * Tasks constructor. |
||
31 | * |
||
32 | * @param ClientInterface $client |
||
33 | * @param TaskFactory $factory |
||
34 | * @param int $roomId |
||
35 | */ |
||
36 | public function __construct(ClientInterface $client, TaskFactory $factory, int $roomId) |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param array $options |
||
45 | * |
||
46 | * @return CollectionInterface |
||
47 | */ |
||
48 | public function show(array $options = []) |
||
49 | { |
||
50 | return $this->factory->collection( |
||
51 | $this->client->get( |
||
52 | "rooms/{$this->roomId}/tasks", |
||
53 | $options |
||
54 | ) |
||
55 | ); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param int $id |
||
60 | * |
||
61 | * @return Task |
||
62 | */ |
||
63 | public function detail($id) |
||
64 | { |
||
65 | return $this->factory->entity( |
||
66 | $this->client->get( |
||
67 | "rooms/{$this->roomId}/tasks/{$id}" |
||
68 | ) |
||
69 | ); |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @param string $body |
||
74 | * @param array $toIds |
||
75 | * @param \DateTime|null $limit |
||
76 | * |
||
77 | * @return int[] task ids |
||
78 | */ |
||
79 | public function create(string $body, array $toIds, \DateTime $limit = null): array |
||
87 | ] |
||
88 | ); |
||
89 | } |
||
91 |