@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | |
31 | 31 | const TYPE = 'portfolio'; |
32 | 32 | |
33 | - final public function __toString (): string { |
|
33 | + final public function __toString(): string { |
|
34 | 34 | return "portfolios/{$this->getGid()}"; |
35 | 35 | } |
36 | 36 | |
37 | - final protected function _getDir (): string { |
|
37 | + final protected function _getDir(): string { |
|
38 | 38 | return 'portfolios'; |
39 | 39 | } |
40 | 40 | |
41 | - protected function _getMap (): array { |
|
41 | + protected function _getMap(): array { |
|
42 | 42 | return [ |
43 | 43 | 'created_by' => User::class, |
44 | 44 | 'owner' => User::class, |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param Project $item |
53 | 53 | * @return $this |
54 | 54 | */ |
55 | - public function addItem (Project $item) { |
|
55 | + public function addItem(Project $item) { |
|
56 | 56 | $this->api->post("{$this}/addItem", ['item' => $item->getGid()]); |
57 | 57 | return $this; |
58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param User $user |
62 | 62 | * @return $this |
63 | 63 | */ |
64 | - public function addMember (User $user) { |
|
64 | + public function addMember(User $user) { |
|
65 | 65 | return $this->addMembers([$user]); |
66 | 66 | } |
67 | 67 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param User[] $users |
70 | 70 | * @return $this |
71 | 71 | */ |
72 | - public function addMembers (array $users) { |
|
72 | + public function addMembers(array $users) { |
|
73 | 73 | if ($this->hasGid()) { |
74 | 74 | $this->api->post("{$this}/addMembers", ['members' => static::_getGids($users)]); |
75 | 75 | $this->_merge('members', $users); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @depends after-create |
85 | 85 | * @return Project[] |
86 | 86 | */ |
87 | - public function getItems () { |
|
87 | + public function getItems() { |
|
88 | 88 | return $this->loadAll(Project::class, "{$this}/items"); |
89 | 89 | } |
90 | 90 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param Project $item |
94 | 94 | * @return $this |
95 | 95 | */ |
96 | - public function removeItem (Project $item) { |
|
96 | + public function removeItem(Project $item) { |
|
97 | 97 | $this->api->post("{$this}/removeItem", ['item' => $item->getGid()]); |
98 | 98 | return $this; |
99 | 99 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @param User $user |
103 | 103 | * @return $this |
104 | 104 | */ |
105 | - public function removeMember (User $user) { |
|
105 | + public function removeMember(User $user) { |
|
106 | 106 | return $this->removeMembers([$user]); |
107 | 107 | } |
108 | 108 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param User[] $users |
111 | 111 | * @return $this |
112 | 112 | */ |
113 | - public function removeMembers (array $users) { |
|
113 | + public function removeMembers(array $users) { |
|
114 | 114 | if ($this->hasGid()) { |
115 | 115 | $this->api->post("{$this}/removeMembers", ['members' => static::_getGids($users)]); |
116 | 116 | } |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | |
24 | 24 | const TYPE = 'section'; |
25 | 25 | |
26 | - final public function __toString (): string { |
|
26 | + final public function __toString(): string { |
|
27 | 27 | return "sections/{$this->getGid()}"; |
28 | 28 | } |
29 | 29 | |
30 | - final protected function _getDir (): string { |
|
30 | + final protected function _getDir(): string { |
|
31 | 31 | return "{$this->getProject()}/sections"; |
32 | 32 | } |
33 | 33 | |
34 | - protected function _getMap (): array { |
|
34 | + protected function _getMap(): array { |
|
35 | 35 | return [ |
36 | 36 | 'projects' => [Project::class] |
37 | 37 | ]; |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * @return Project |
42 | 42 | */ |
43 | - public function getProject () { |
|
43 | + public function getProject() { |
|
44 | 44 | return $this->_get('projects')[0]; |
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @return Task[] |
49 | 49 | */ |
50 | - public function getTasks () { |
|
50 | + public function getTasks() { |
|
51 | 51 | return $this->loadAll(Task::class, 'tasks', ['section' => $this->getGid()]); |
52 | 52 | } |
53 | 53 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @depends after-create |
58 | 58 | * @return Task |
59 | 59 | */ |
60 | - public function newTask () { |
|
60 | + public function newTask() { |
|
61 | 61 | /** @var Task $task */ |
62 | 62 | $task = $this->factory(Task::class); |
63 | 63 | return $task->addToProject($this); |
@@ -56,15 +56,15 @@ discard block |
||
56 | 56 | const LAYOUT_BOARD = 'board'; |
57 | 57 | const LAYOUT_LIST = 'list'; |
58 | 58 | |
59 | - final public function __toString (): string { |
|
59 | + final public function __toString(): string { |
|
60 | 60 | return "projects/{$this->getGid()}"; |
61 | 61 | } |
62 | 62 | |
63 | - final protected function _getDir (): string { |
|
63 | + final protected function _getDir(): string { |
|
64 | 64 | return 'projects'; |
65 | 65 | } |
66 | 66 | |
67 | - protected function _getMap (): array { |
|
67 | + protected function _getMap(): array { |
|
68 | 68 | return [ |
69 | 69 | 'current_status' => Status::class, |
70 | 70 | 'custom_fields' => [CustomField::class], |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @param User $user |
82 | 82 | * @return $this |
83 | 83 | */ |
84 | - public function addMember (User $user) { |
|
84 | + public function addMember(User $user) { |
|
85 | 85 | return $this->addMembers([$user]); |
86 | 86 | } |
87 | 87 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param User[] $users |
91 | 91 | * @return $this |
92 | 92 | */ |
93 | - public function addMembers (array $users) { |
|
93 | + public function addMembers(array $users) { |
|
94 | 94 | $this->api->post("{$this}/addMembers", ['members' => static::_getGids($users)]); |
95 | 95 | $this->_merge('members', $users); |
96 | 96 | return $this; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param string $target |
102 | 102 | * @return ProjectWebhook |
103 | 103 | */ |
104 | - public function addWebhook (string $target) { |
|
104 | + public function addWebhook(string $target) { |
|
105 | 105 | /** @var ProjectWebhook $webhook */ |
106 | 106 | $webhook = $this->factory(ProjectWebhook::class); |
107 | 107 | return $webhook->create($this, $target); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @param array $schedule |
127 | 127 | * @return Job |
128 | 128 | */ |
129 | - public function duplicate (string $name, array $include, Team $team = null, array $schedule = []) { |
|
129 | + public function duplicate(string $name, array $include, Team $team = null, array $schedule = []) { |
|
130 | 130 | $data = ['name' => $name]; |
131 | 131 | if ($team) { |
132 | 132 | $data['team'] = $team->getGid(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param string $token |
147 | 147 | * @return ProjectEvent[]|TaskEvent[]|StoryEvent[] |
148 | 148 | */ |
149 | - public function getEvents (string &$token) { |
|
149 | + public function getEvents(string &$token) { |
|
150 | 150 | return $this->api->sync($this, $token); |
151 | 151 | } |
152 | 152 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @depends after-create |
155 | 155 | * @return Section[] |
156 | 156 | */ |
157 | - public function getSections () { |
|
157 | + public function getSections() { |
|
158 | 158 | return $this->loadAll(Section::class, "{$this}/sections"); |
159 | 159 | } |
160 | 160 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * @depends after-create |
163 | 163 | * @return Status[] |
164 | 164 | */ |
165 | - public function getStatuses () { |
|
165 | + public function getStatuses() { |
|
166 | 166 | return $this->loadAll(Status::class, "{$this}/project_statuses"); |
167 | 167 | } |
168 | 168 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param array $query |
172 | 172 | * @return Task[] |
173 | 173 | */ |
174 | - public function getTasks (array $query = []) { |
|
174 | + public function getTasks(array $query = []) { |
|
175 | 175 | $query['project'] = $this->getGid(); |
176 | 176 | return $this->loadAll(Task::class, "tasks", $query); |
177 | 177 | } |
@@ -180,25 +180,25 @@ discard block |
||
180 | 180 | * @depends after-create |
181 | 181 | * @return string |
182 | 182 | */ |
183 | - public function getUrl (): string { |
|
183 | + public function getUrl(): string { |
|
184 | 184 | return "https://app.asana.com/0/{$this->getGid()}"; |
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
188 | 188 | * @return ProjectWebhook[] |
189 | 189 | */ |
190 | - public function getWebhooks () { |
|
190 | + public function getWebhooks() { |
|
191 | 191 | return $this->loadAll(ProjectWebhook::class, 'webhooks', [ |
192 | 192 | 'workspace' => $this->getWorkspace()->getGid(), |
193 | 193 | 'resource' => $this->getGid() |
194 | 194 | ]); |
195 | 195 | } |
196 | 196 | |
197 | - public function isBoard (): bool { |
|
197 | + public function isBoard(): bool { |
|
198 | 198 | return $this->getLayout() === self::LAYOUT_BOARD; |
199 | 199 | } |
200 | 200 | |
201 | - public function isList (): bool { |
|
201 | + public function isList(): bool { |
|
202 | 202 | return $this->getLayout() === self::LAYOUT_LIST; |
203 | 203 | } |
204 | 204 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @depends after-create |
207 | 207 | * @return Section |
208 | 208 | */ |
209 | - public function newSection () { |
|
209 | + public function newSection() { |
|
210 | 210 | return $this->factory(Section::class, ['projects' => [$this]]); |
211 | 211 | } |
212 | 212 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @depends after-create |
215 | 215 | * @return Status |
216 | 216 | */ |
217 | - public function newStatus () { |
|
217 | + public function newStatus() { |
|
218 | 218 | return $this->factory(Status::class); |
219 | 219 | } |
220 | 220 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * @depends after-create |
225 | 225 | * @return Task |
226 | 226 | */ |
227 | - public function newTask () { |
|
227 | + public function newTask() { |
|
228 | 228 | return $this->getSections()[0]->newTask(); |
229 | 229 | } |
230 | 230 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @param User $user |
234 | 234 | * @return $this |
235 | 235 | */ |
236 | - public function removeMember (User $user) { |
|
236 | + public function removeMember(User $user) { |
|
237 | 237 | return $this->removeMembers([$user]); |
238 | 238 | } |
239 | 239 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param User[] $users |
243 | 243 | * @return $this |
244 | 244 | */ |
245 | - public function removeMembers (array $users) { |
|
245 | + public function removeMembers(array $users) { |
|
246 | 246 | $this->api->post("{$this}/removeMembers", ['members' => static::_getGids($users)]); |
247 | 247 | $this->_remove('members', $users); |
248 | 248 | return $this; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @param null|Team $team |
254 | 254 | * @return $this |
255 | 255 | */ |
256 | - public function setTeam (?Team $team) { |
|
256 | + public function setTeam(?Team $team) { |
|
257 | 257 | assert(!$this->hasGid()); |
258 | 258 | if ($team and !$this->hasWorkspace()) { |
259 | 259 | $this->setWorkspace($team->getOrganization()); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param Api|Data $caller |
31 | 31 | * @param array $data |
32 | 32 | */ |
33 | - public function __construct ($caller, array $data = []) { |
|
33 | + public function __construct($caller, array $data = []) { |
|
34 | 34 | $this->api = $caller instanceof self ? $caller->api : $caller; |
35 | 35 | $this->_setData($data); |
36 | 36 | } |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | * @param array $args |
47 | 47 | * @return mixed |
48 | 48 | */ |
49 | - public function __call (string $method, array $args) { |
|
49 | + public function __call(string $method, array $args) { |
|
50 | 50 | static $cache = []; |
51 | - if (!$call =& $cache[$method]) { |
|
51 | + if (!$call = & $cache[$method]) { |
|
52 | 52 | preg_match('/^(get|has|is|set)(.+)$/', $method, $call); |
53 | 53 | $call[1] = '_' . $call[1]; |
54 | 54 | $call[2] = preg_replace_callback('/[A-Z]/', function(array $match) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return $this->{$call[1]}($call[2], ...$args); |
59 | 59 | } |
60 | 60 | |
61 | - public function __debugInfo (): array { |
|
61 | + public function __debugInfo(): array { |
|
62 | 62 | return $this->data; |
63 | 63 | } |
64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param string $key |
71 | 71 | * @return mixed |
72 | 72 | */ |
73 | - protected function _get (string $key) { |
|
73 | + protected function _get(string $key) { |
|
74 | 74 | return $this->data[$key] ?? null; |
75 | 75 | } |
76 | 76 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @return array |
84 | 84 | */ |
85 | - protected function _getMap (): array { |
|
85 | + protected function _getMap(): array { |
|
86 | 86 | return []; |
87 | 87 | } |
88 | 88 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @param null|self|array $value |
92 | 92 | * @return null|Data|Data[] |
93 | 93 | */ |
94 | - protected function _getMapped ($class, $value) { |
|
94 | + protected function _getMapped($class, $value) { |
|
95 | 95 | // use empty|Data|Data[] as-is |
96 | 96 | if (!$value or $value instanceof self or current($value) instanceof self) { |
97 | 97 | return $value; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * |
125 | 125 | * @return array |
126 | 126 | */ |
127 | - protected function _getPatch (): array { |
|
127 | + protected function _getPatch(): array { |
|
128 | 128 | $convert = function($each) use (&$convert) { |
129 | 129 | // convert existing entities to gids |
130 | 130 | if ($each instanceof AbstractEntity and $each->hasGid()) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @param string $key |
155 | 155 | * @return bool |
156 | 156 | */ |
157 | - protected function _has (string $key): bool { |
|
157 | + protected function _has(string $key): bool { |
|
158 | 158 | $value = $this->_get($key); |
159 | 159 | if (isset($value)) { |
160 | 160 | if (is_countable($value)) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | * @param string $key |
178 | 178 | * @return bool |
179 | 179 | */ |
180 | - protected function _is (string $key): bool { |
|
180 | + protected function _is(string $key): bool { |
|
181 | 181 | return !empty($this->_get($key)); |
182 | 182 | } |
183 | 183 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @param mixed $value |
191 | 191 | * @return $this |
192 | 192 | */ |
193 | - protected function _set (string $key, $value) { |
|
193 | + protected function _set(string $key, $value) { |
|
194 | 194 | $this->data[$key] = $value; |
195 | 195 | $this->diff[$key] = true; |
196 | 196 | return $this; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @param array $data |
203 | 203 | * @return $this |
204 | 204 | */ |
205 | - protected function _setData (array $data) { |
|
205 | + protected function _setData(array $data) { |
|
206 | 206 | $map = $this->_getMap(); |
207 | 207 | /** @var null|self|array $value */ |
208 | 208 | foreach (array_intersect_key($data, $map) as $key => $value) { |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * @param array $data |
221 | 221 | * @return mixed |
222 | 222 | */ |
223 | - final protected function factory (string $class, array $data = []) { |
|
223 | + final protected function factory(string $class, array $data = []) { |
|
224 | 224 | return $this->api->factory($class, $this, $data); |
225 | 225 | } |
226 | 226 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @return bool |
231 | 231 | */ |
232 | - final public function isDiff (): bool { |
|
232 | + final public function isDiff(): bool { |
|
233 | 233 | return (bool)$this->diff; |
234 | 234 | } |
235 | 235 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @see toArray() |
238 | 238 | * @return array |
239 | 239 | */ |
240 | - public function jsonSerialize (): array { |
|
240 | + public function jsonSerialize(): array { |
|
241 | 241 | return $this->toArray(); |
242 | 242 | } |
243 | 243 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @param array $query |
252 | 252 | * @return null|mixed|AbstractEntity |
253 | 253 | */ |
254 | - final protected function load (string $class, string $path, array $query = []) { |
|
254 | + final protected function load(string $class, string $path, array $query = []) { |
|
255 | 255 | return $this->api->load($class, $this, $path, $query); |
256 | 256 | } |
257 | 257 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @param int $pages |
267 | 267 | * @return array|AbstractEntity[] |
268 | 268 | */ |
269 | - final protected function loadAll (string $class, string $path, array $query = [], int $pages = 0) { |
|
269 | + final protected function loadAll(string $class, string $path, array $query = [], int $pages = 0) { |
|
270 | 270 | return $this->api->loadAll($class, $this, $path, $query, $pages); |
271 | 271 | } |
272 | 272 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * |
278 | 278 | * @return string |
279 | 279 | */ |
280 | - public function serialize (): string { |
|
280 | + public function serialize(): string { |
|
281 | 281 | return serialize($this->toArray()); |
282 | 282 | } |
283 | 283 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * |
287 | 287 | * @return array |
288 | 288 | */ |
289 | - public function toArray (): array { |
|
289 | + public function toArray(): array { |
|
290 | 290 | if (!$this->api) { |
291 | 291 | return $this->data; |
292 | 292 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | * |
313 | 313 | * @param $serialized |
314 | 314 | */ |
315 | - public function unserialize ($serialized): void { |
|
315 | + public function unserialize($serialized): void { |
|
316 | 316 | $this->data = unserialize($serialized); |
317 | 317 | } |
318 | 318 | } |
319 | 319 | \ No newline at end of file |
@@ -67,15 +67,15 @@ discard block |
||
67 | 67 | const ASSIGN_TODAY = 'today'; |
68 | 68 | const ASSIGN_UPCOMING = 'upcoming'; |
69 | 69 | |
70 | - final public function __toString (): string { |
|
70 | + final public function __toString(): string { |
|
71 | 71 | return "tasks/{$this->getGid()}"; |
72 | 72 | } |
73 | 73 | |
74 | - final protected function _getDir (): string { |
|
74 | + final protected function _getDir(): string { |
|
75 | 75 | return 'tasks'; |
76 | 76 | } |
77 | 77 | |
78 | - protected function _getMap (): array { |
|
78 | + protected function _getMap(): array { |
|
79 | 79 | return [ |
80 | 80 | 'assignee' => User::class, |
81 | 81 | 'custom_fields' => [CustomField::class], |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @param string $file |
97 | 97 | * @return Attachment |
98 | 98 | */ |
99 | - public function addAttachment (string $file) { |
|
99 | + public function addAttachment(string $file) { |
|
100 | 100 | /** @var Attachment $attachment */ |
101 | 101 | $attachment = $this->factory(Attachment::class, ['parent' => $this]); |
102 | 102 | return $attachment->upload($file); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @param string $text |
110 | 110 | * @return Story |
111 | 111 | */ |
112 | - public function addComment (string $text) { |
|
112 | + public function addComment(string $text) { |
|
113 | 113 | return $this->newComment()->setText($text)->create(); |
114 | 114 | } |
115 | 115 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @param Task[] $tasks |
121 | 121 | * @return $this |
122 | 122 | */ |
123 | - public function addDependencies (array $tasks) { |
|
123 | + public function addDependencies(array $tasks) { |
|
124 | 124 | $this->api->post("{$this}/addDependencies", ['dependents' => static::_getGids($tasks)]); |
125 | 125 | return $this; |
126 | 126 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @param Task $task |
133 | 133 | * @return $this |
134 | 134 | */ |
135 | - public function addDependency (Task $task) { |
|
135 | + public function addDependency(Task $task) { |
|
136 | 136 | return $this->addDependencies([$task]); |
137 | 137 | } |
138 | 138 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param Task $task |
144 | 144 | * @return $this |
145 | 145 | */ |
146 | - public function addDependent (Task $task) { |
|
146 | + public function addDependent(Task $task) { |
|
147 | 147 | return $this->addDependents([$task]); |
148 | 148 | } |
149 | 149 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @param Task[] $tasks |
155 | 155 | * @return $this |
156 | 156 | */ |
157 | - public function addDependents (array $tasks) { |
|
157 | + public function addDependents(array $tasks) { |
|
158 | 158 | $this->api->post("{$this}/addDependents", ['dependents' => static::_getGids($tasks)]); |
159 | 159 | return $this; |
160 | 160 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @param User $user |
166 | 166 | * @return $this |
167 | 167 | */ |
168 | - public function addFollower (User $user) { |
|
168 | + public function addFollower(User $user) { |
|
169 | 169 | return $this->addFollowers([$user]); |
170 | 170 | } |
171 | 171 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * @param User[] $users |
176 | 176 | * @return $this |
177 | 177 | */ |
178 | - public function addFollowers (array $users) { |
|
178 | + public function addFollowers(array $users) { |
|
179 | 179 | if ($this->hasGid()) { |
180 | 180 | $this->api->post("{$this}/addFollowers", ['followers' => static::_getGids($users)]); |
181 | 181 | $this->_merge('followers', $users); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @param Tag $tag |
193 | 193 | * @return $this |
194 | 194 | */ |
195 | - public function addTag (Tag $tag) { |
|
195 | + public function addTag(Tag $tag) { |
|
196 | 196 | if ($this->hasGid()) { |
197 | 197 | $this->api->post("{$this}/addTag", ['tag' => $tag->getGid()]); |
198 | 198 | $this->_merge('tags', [$tag]); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @param Section $section |
210 | 210 | * @return $this |
211 | 211 | */ |
212 | - public function addToProject (Section $section) { |
|
212 | + public function addToProject(Section $section) { |
|
213 | 213 | $project = $section->getProject(); |
214 | 214 | if ($this->hasGid()) { |
215 | 215 | $this->api->post("{$this}/addProject", [ |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param string $target |
244 | 244 | * @return TaskWebhook |
245 | 245 | */ |
246 | - public function addWebhook (string $target) { |
|
246 | + public function addWebhook(string $target) { |
|
247 | 247 | /** @var TaskWebhook $webhook */ |
248 | 248 | $webhook = $this->factory(TaskWebhook::class); |
249 | 249 | return $webhook->create($this, $target); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param string[] $include |
260 | 260 | * @return Job |
261 | 261 | */ |
262 | - public function duplicate (string $name, array $include) { |
|
262 | + public function duplicate(string $name, array $include) { |
|
263 | 263 | $remote = $this->api->post("{$this}/duplicate", [ |
264 | 264 | 'name' => $name, |
265 | 265 | 'include' => array_values($include) |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * @depends after-create |
274 | 274 | * @return Attachment[] |
275 | 275 | */ |
276 | - public function getAttachments () { |
|
276 | + public function getAttachments() { |
|
277 | 277 | return $this->loadAll(Attachment::class, "{$this}/attachments"); |
278 | 278 | } |
279 | 279 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @depends after-create |
284 | 284 | * @return Story[] |
285 | 285 | */ |
286 | - public function getComments () { |
|
286 | + public function getComments() { |
|
287 | 287 | return array_values(array_filter($this->getStories(), function(Story $story) { |
288 | 288 | return $story->isComment(); |
289 | 289 | })); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * @depends after-create |
296 | 296 | * @return Task[] |
297 | 297 | */ |
298 | - public function getDependencies () { |
|
298 | + public function getDependencies() { |
|
299 | 299 | return $this->loadAll(self::class, "{$this}/dependencies"); |
300 | 300 | } |
301 | 301 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | * @depends after-create |
306 | 306 | * @return Task[] |
307 | 307 | */ |
308 | - public function getDependents () { |
|
308 | + public function getDependents() { |
|
309 | 309 | return $this->loadAll(self::class, "{$this}/dependents"); |
310 | 310 | } |
311 | 311 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * @param string $token |
317 | 317 | * @return TaskEvent[]|StoryEvent[] |
318 | 318 | */ |
319 | - public function getEvents (string &$token) { |
|
319 | + public function getEvents(string &$token) { |
|
320 | 320 | return $this->api->sync($this, $token); |
321 | 321 | } |
322 | 322 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | * @depends after-create |
327 | 327 | * @return Story[] |
328 | 328 | */ |
329 | - public function getStories () { |
|
329 | + public function getStories() { |
|
330 | 330 | return $this->loadAll(Story::class, "{$this}/stories"); |
331 | 331 | } |
332 | 332 | |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | * @depends after-create |
337 | 337 | * @return Task[] |
338 | 338 | */ |
339 | - public function getSubTasks () { |
|
339 | + public function getSubTasks() { |
|
340 | 340 | return $this->loadAll(self::class, "{$this}/subtasks"); |
341 | 341 | } |
342 | 342 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | * @depends after-create |
347 | 347 | * @return string |
348 | 348 | */ |
349 | - public function getUrl (): string { |
|
349 | + public function getUrl(): string { |
|
350 | 350 | return "https://app.asana.com/0/0/{$this->getGid()}"; |
351 | 351 | } |
352 | 352 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | * @depends after-create |
357 | 357 | * @return TaskWebhook[] |
358 | 358 | */ |
359 | - public function getWebhooks () { |
|
359 | + public function getWebhooks() { |
|
360 | 360 | return $this->loadAll(TaskWebhook::class, 'webhooks', [ |
361 | 361 | 'workspace' => $this->getWorkspace()->getGid(), |
362 | 362 | 'resource' => $this->getGid() |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | /** |
367 | 367 | * @return bool |
368 | 368 | */ |
369 | - public function isRenderedAsSeparator (): bool { |
|
369 | + public function isRenderedAsSeparator(): bool { |
|
370 | 370 | return $this->_is('is_rendered_as_separator'); |
371 | 371 | } |
372 | 372 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | * @depends after-create |
377 | 377 | * @return Story |
378 | 378 | */ |
379 | - public function newComment () { |
|
379 | + public function newComment() { |
|
380 | 380 | /** @var Story $comment */ |
381 | 381 | $comment = $this->factory(Story::class, [ |
382 | 382 | 'resource_subtype' => Story::TYPE_COMMENT_ADDED |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | * @depends after-create |
391 | 391 | * @return Task |
392 | 392 | */ |
393 | - public function newSubTask () { |
|
393 | + public function newSubTask() { |
|
394 | 394 | /** @var Task $sub */ |
395 | 395 | $sub = $this->factory(self::class); |
396 | 396 | return $sub->setParent($this); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | * @param Task[] $tasks |
404 | 404 | * @return $this |
405 | 405 | */ |
406 | - public function removeDependencies (array $tasks) { |
|
406 | + public function removeDependencies(array $tasks) { |
|
407 | 407 | $this->api->post("{$this}/removeDependencies", ['dependencies' => static::_getGids($tasks)]); |
408 | 408 | return $this; |
409 | 409 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @param Task $task |
416 | 416 | * @return $this |
417 | 417 | */ |
418 | - public function removeDependency (Task $task) { |
|
418 | + public function removeDependency(Task $task) { |
|
419 | 419 | return $this->removeDependencies([$task]); |
420 | 420 | } |
421 | 421 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | * @param Task $task |
427 | 427 | * @return $this |
428 | 428 | */ |
429 | - public function removeDependent (Task $task) { |
|
429 | + public function removeDependent(Task $task) { |
|
430 | 430 | return $this->removeDependents([$task]); |
431 | 431 | } |
432 | 432 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * @param Task[] $tasks |
438 | 438 | * @return $this |
439 | 439 | */ |
440 | - public function removeDependents (array $tasks) { |
|
440 | + public function removeDependents(array $tasks) { |
|
441 | 441 | $this->api->post("{$this}/removeDependents", ['dependents' => static::_getGids($tasks)]); |
442 | 442 | return $this; |
443 | 443 | } |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | * @param User $user |
449 | 449 | * @return $this |
450 | 450 | */ |
451 | - public function removeFollower (User $user) { |
|
451 | + public function removeFollower(User $user) { |
|
452 | 452 | return $this->removeFollowers([$user]); |
453 | 453 | } |
454 | 454 | |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | * @param User[] $users |
459 | 459 | * @return $this |
460 | 460 | */ |
461 | - public function removeFollowers (array $users) { |
|
461 | + public function removeFollowers(array $users) { |
|
462 | 462 | if ($this->hasGid()) { |
463 | 463 | $this->api->post("{$this}/removeFollowers", ['followers' => static::_getGids($users)]); |
464 | 464 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | * @param Project $project |
473 | 473 | * @return $this |
474 | 474 | */ |
475 | - public function removeFromProject (Project $project) { |
|
475 | + public function removeFromProject(Project $project) { |
|
476 | 476 | $gid = $project->getGid(); |
477 | 477 | if ($this->hasGid()) { |
478 | 478 | $this->api->post("{$this}/removeProject", ['project' => $gid]); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | * @param Tag $tag |
492 | 492 | * @return $this |
493 | 493 | */ |
494 | - public function removeTag (Tag $tag) { |
|
494 | + public function removeTag(Tag $tag) { |
|
495 | 495 | if ($this->hasGid()) { |
496 | 496 | $this->api->post("{$this}/removeTag", ['tag' => $tag->getGid()]); |
497 | 497 | } |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | * @param null|Task $parent |
506 | 506 | * @return $this |
507 | 507 | */ |
508 | - public function setParent (?self $parent) { |
|
508 | + public function setParent(?self $parent) { |
|
509 | 509 | if ($this->hasGid()) { |
510 | 510 | $this->api->post("{$this}/setParent", ['parent' => $parent ? $parent->getGid() : null]); |
511 | 511 | $this->data['parent'] = $parent; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | * @param bool $flag |
521 | 521 | * @return $this |
522 | 522 | */ |
523 | - public function setRenderedAsSeparator (bool $flag) { |
|
523 | + public function setRenderedAsSeparator(bool $flag) { |
|
524 | 524 | return $this->_set('is_rendered_as_separator', $flag); |
525 | 525 | } |
526 | 526 | } |
527 | 527 | \ No newline at end of file |