|
7 | 7 |
|
8 | 8 | class Projects extends Service |
9 | 9 | { |
10 | | - /** |
11 | | - * Projects Endpoint constructor. |
12 | | - * |
13 | | - * @param Api $root |
14 | | - */ |
15 | | - public function __construct(RestClient $root) |
16 | | - { |
17 | | - parent::__construct($root, 'projects'); |
18 | | - } |
19 | | - |
20 | | - /** |
21 | | - * @param array $data |
22 | | - * - member: member id |
23 | | - * - members: member ids |
24 | | - * - is_looking_for_people: the project is looking for new members |
25 | | - * - is_featured: the project has been highlighted by the instance staff |
26 | | - * - is_backlog_activated: backlog is active |
27 | | - * - is_kanban_activated: kanban is active |
28 | | - * |
29 | | - * @return \stdClass[] |
30 | | - */ |
| 10 | + |
| 11 | + public function __construct(RestClient $taiga) |
| 12 | + { |
| 13 | + parent::__construct($taiga, 'projects'); |
| 14 | + } |
| 15 | + |
31 | 16 | public function getList(array $param = []) |
32 | 17 | { |
33 | 18 | return $this->get(null, $param); |
34 | 19 | } |
35 | 20 |
|
36 | | - /** |
37 | | - * @param $id |
38 | | - * |
39 | | - * @return array |
40 | | - */ |
41 | 21 | public function getById($id) |
42 | 22 | { |
43 | 23 | return $this->get($id); |
44 | 24 | } |
45 | 25 |
|
46 | | - /** |
47 | | - * @param $slug |
48 | | - * |
49 | | - * @return array |
50 | | - */ |
51 | 26 | public function getBySlug($slug) |
52 | 27 | { |
53 | 28 | return $this->get('by_slug', ['slug' => $slug]); |
54 | 29 | } |
55 | 30 |
|
56 | | - /** |
57 | | - * @param $id |
58 | | - * |
59 | | - * @return array |
60 | | - */ |
61 | 31 | public function getProjectModulesConfiguration($id) |
62 | 32 | { |
63 | 33 | return $this->get(sprintf('%s/modules', $id)); |
64 | 34 | } |
65 | 35 |
|
66 | | - /** |
67 | | - * @param $id |
68 | | - * |
69 | | - * @return array |
70 | | - */ |
71 | 36 | public function getProjectStats($id) |
72 | 37 | { |
73 | 38 | return $this->get(sprintf('%s/stats', $id)); |
74 | 39 | } |
75 | 40 |
|
76 | | - /** |
77 | | - * @param $id |
78 | | - * |
79 | | - * @return array |
80 | | - */ |
81 | 41 | public function getProjectIssueStats($id) |
82 | 42 | { |
83 | 43 | return $this->get(sprintf('%s/issues_stats', $id)); |
84 | 44 | } |
85 | 45 |
|
86 | | - /** |
87 | | - * @param $id |
88 | | - * |
89 | | - * @return array |
90 | | - */ |
91 | 46 | public function getProjectIssueFiltersData($id) |
92 | 47 | { |
93 | 48 | return $this->get(sprintf('%s/issue_filters_data', $id)); |
94 | 49 | } |
95 | 50 |
|
96 | | - /** |
97 | | - * @param $id |
98 | | - * |
99 | | - * @return array |
100 | | - */ |
101 | 51 | public function getProjectTagsColors($id) |
102 | 52 | { |
103 | 53 | return $this->get(sprintf('%s/tags_colors', $id)); |
104 | 54 | } |
105 | 55 |
|
106 | | - /** |
107 | | - * @param $id |
108 | | - * |
109 | | - * @return array |
110 | | - */ |
111 | 56 | public function getFans($id) |
112 | 57 | { |
113 | 58 | return $this->get(sprintf('%s/fans', $id)); |
114 | 59 | } |
115 | 60 |
|
116 | | - /** |
117 | | - * @param $id |
118 | | - * |
119 | | - * @return array |
120 | | - */ |
121 | 61 | public function getWatchers($id) |
122 | 62 | { |
123 | 63 | return $this->get(sprintf('%s/watchers', $id)); |
124 | 64 | } |
125 | 65 |
|
126 | | - /** |
127 | | - * @param $data |
128 | | - * |
129 | | - * @return array |
130 | | - */ |
131 | 66 | public function create(array $data) |
132 | 67 | { |
133 | 68 | return $this->post(null, [], $data); |
134 | 69 | } |
135 | 70 |
|
136 | | - /** |
137 | | - * @param $id |
138 | | - * @param $data |
139 | | - */ |
140 | 71 | public function updateProjectsOrderForLoggedInUser($id, array $data) |
141 | 72 | { |
142 | 73 | return $this->post(sprintf('%s/bulk_update_order', $id), [], $data); |
143 | 74 | } |
144 | 75 |
|
145 | | - /** |
146 | | - * @param $id |
147 | | - * @param $data |
148 | | - */ |
149 | 76 | public function like($id, array $data) |
150 | 77 | { |
151 | 78 | return $this->post(sprintf('%s/like', $id), [], $data); |
152 | 79 | } |
153 | 80 |
|
154 | | - /** |
155 | | - * @param $id |
156 | | - * @param $data |
157 | | - */ |
158 | 81 | public function unlike($id, array $data) |
159 | 82 | { |
160 | 83 | return $this->post(sprintf('%s/unlike', $id), [], $data); |
161 | 84 | } |
162 | 85 |
|
163 | | - /** |
164 | | - * @param $id |
165 | | - * @param $data |
166 | | - */ |
167 | 86 | public function watch($id, array $data) |
168 | 87 | { |
169 | 88 | return $this->post(sprintf('%s/watch', $id), [], $data); |
170 | 89 | } |
171 | 90 |
|
172 | | - /** |
173 | | - * @param $id |
174 | | - * @param $data |
175 | | - */ |
176 | 91 | public function unwatch($id, array $data) |
177 | 92 | { |
178 | 93 | return $this->post(sprintf('%s/unwatch', $id), [], $data); |
179 | 94 | } |
180 | 95 |
|
181 | | - /** |
182 | | - * @param $id |
183 | | - * @param $data |
184 | | - */ |
185 | 96 | public function createTemplate($id, array $data) |
186 | 97 | { |
187 | 98 | return $this->post(sprintf('%s/create_template', $id), [], $data); |
188 | 99 | } |
189 | 100 |
|
190 | | - /** |
191 | | - * @param $id |
192 | | - * @param $data |
193 | | - */ |
194 | 101 | public function leave($id, array $data) |
195 | 102 | { |
196 | 103 | return $this->post(sprintf('%s/leave', $id), [], $data); |
197 | 104 | } |
198 | 105 |
|
199 | | - /** |
200 | | - * @param $id |
201 | | - * @param $data |
202 | | - */ |
203 | 106 | public function changeLogo($id, array $data) |
204 | 107 | { |
205 | 108 | return $this->post(sprintf('%s/change_logo', $id), [], $data); |
206 | 109 | } |
207 | 110 |
|
208 | | - /** |
209 | | - * @param $id |
210 | | - * @param $data |
211 | | - */ |
212 | 111 | public function removeLogo($id, array $data) |
213 | 112 | { |
214 | 113 | return $this->post(sprintf('%s/remove_logo', $id), [], $data); |
215 | 114 | } |
216 | 115 |
|
217 | | - /** |
218 | | - * @param $id |
219 | | - * @param $data |
220 | | - */ |
221 | 116 | public function modifyPartiallyAProject($id, $data) |
222 | 117 | { |
223 | 118 | return $this->patch(sprintf('%s', $id), [], $data); |
224 | 119 | } |
225 | 120 |
|
226 | | - /** |
227 | | - * @param $id |
228 | | - * @param $data |
229 | | - */ |
230 | 121 | public function modifyPartiallyAProjectModulesConfiguration($id, array $data) |
231 | 122 | { |
232 | 123 | return $this->patch(sprintf('%s/modules', $id), [], $data); |
233 | 124 | } |
234 | 125 |
|
235 | | - /** |
236 | | - * @param $id |
237 | | - * @param $data |
238 | | - */ |
239 | 126 | public function edit($id, array $data) |
240 | 127 | { |
241 | 128 | return $this->put($id, [], $data); |
|
0 commit comments