Passed
Push — master ( 44af68...262356 )
by y
01:43
created
src/Project/Section.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      *
37 37
      * @return string
38 38
      */
39
-    final public function __toString (): string {
39
+    final public function __toString(): string {
40 40
         return "sections/{$this->getGid()}";
41 41
     }
42 42
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @return string
47 47
      */
48
-    final protected function _getDir (): string {
48
+    final protected function _getDir(): string {
49 49
         return "{$this->getProject()}/sections";
50 50
     }
51 51
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param array $filter
54 54
      * @return Traversable|Task[]
55 55
      */
56
-    public function getIterator (array $filter = Task::GET_INCOMPLETE) {
56
+    public function getIterator(array $filter = Task::GET_INCOMPLETE) {
57 57
         $filter['section'] = $this->getGid();
58 58
         return $this->api->loadEach($this, Task::class, 'tasks', $filter);
59 59
     }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param array $filter
63 63
      * @return Task[]
64 64
      */
65
-    public function getTasks (array $filter = Task::GET_INCOMPLETE) {
65
+    public function getTasks(array $filter = Task::GET_INCOMPLETE) {
66 66
         return iterator_to_array($this->getIterator($filter));
67 67
     }
68 68
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @depends after-create
73 73
      * @return Task
74 74
      */
75
-    public function newTask () {
75
+    public function newTask() {
76 76
         /** @var Task $task */
77 77
         $task = $this->api->factory($this, Task::class);
78 78
         return $task->addToProject($this);
Please login to merge, or discard this patch.
src/CustomField.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return string
50 50
      */
51
-    final public function __toString (): string {
51
+    final public function __toString(): string {
52 52
         return "custom_fields/{$this->getGid()}";
53 53
     }
54 54
 
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * @return string
59 59
      */
60
-    final protected function _getDir (): string {
60
+    final protected function _getDir(): string {
61 61
         return 'custom_fields';
62 62
     }
63 63
 
64
-    protected function _setData (array $data): void {
64
+    protected function _setData(array $data): void {
65 65
         // strip out field entry values if present.
66 66
         $data = array_intersect_key($data, array_flip([
67 67
             'gid',
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @param string $name
83 83
      * @return EnumOption
84 84
      */
85
-    public function addEnumOption (string $name) {
85
+    public function addEnumOption(string $name) {
86 86
         /** @var EnumOption $option */
87 87
         $option = $this->api->factory($this, EnumOption::class);
88 88
         $option->setName($name);
@@ -98,35 +98,35 @@  discard block
 block discarded – undo
98 98
     /**
99 99
      * @return bool
100 100
      */
101
-    final public function hasNotificationsEnabled (): bool {
101
+    final public function hasNotificationsEnabled(): bool {
102 102
         return $this->_is('has_notifications_enabled');
103 103
     }
104 104
 
105 105
     /**
106 106
      * @return bool
107 107
      */
108
-    final public function isEnum (): bool {
108
+    final public function isEnum(): bool {
109 109
         return $this->getResourceSubtype() === self::TYPE_ENUM;
110 110
     }
111 111
 
112 112
     /**
113 113
      * @return bool
114 114
      */
115
-    final public function isGlobalToWorkspace (): bool {
115
+    final public function isGlobalToWorkspace(): bool {
116 116
         return $this->_is('is_global_to_workspace');
117 117
     }
118 118
 
119 119
     /**
120 120
      * @return bool
121 121
      */
122
-    final public function isNumber (): bool {
122
+    final public function isNumber(): bool {
123 123
         return $this->getResourceSubtype() === self::TYPE_NUMBER;
124 124
     }
125 125
 
126 126
     /**
127 127
      * @return bool
128 128
      */
129
-    final public function isText (): bool {
129
+    final public function isText(): bool {
130 130
         return $this->getResourceSubtype() === self::TYPE_TEXT;
131 131
     }
132 132
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @param bool $flag
135 135
      * @return $this
136 136
      */
137
-    final public function setGlobalToWorkspace (bool $flag) {
137
+    final public function setGlobalToWorkspace(bool $flag) {
138 138
         return $this->_set('is_global_to_workspace', $flag);
139 139
     }
140 140
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @param bool $flag
143 143
      * @return $this
144 144
      */
145
-    final public function setNotificationsEnabled (bool $flag) {
145
+    final public function setNotificationsEnabled(bool $flag) {
146 146
         return $this->_set('has_notifications_enabled', $flag);
147 147
     }
148 148
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @param callable $cmp `fn( EnumOption $a, EnumOption $b ): int`
151 151
      * @return $this
152 152
      */
153
-    public function sortEnumOptions (callable $cmp) {
153
+    public function sortEnumOptions(callable $cmp) {
154 154
         if ($options = $this->getEnumOptions()) {
155 155
             $prev = $options[0]; // first option on remote
156 156
             usort($options, $cmp);
Please login to merge, or discard this patch.
src/Workspace/WorkspaceTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      * @param Workspace $workspace
21 21
      * @return $this
22 22
      */
23
-    final public function setWorkspace (Workspace $workspace) {
23
+    final public function setWorkspace(Workspace $workspace) {
24 24
         return $this->_set('workspace', $workspace);
25 25
     }
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/Workspace/OrganizationExport.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @return string
40 40
      */
41
-    final public function __toString (): string {
41
+    final public function __toString(): string {
42 42
         return "organization_exports/{$this->getGid()}";
43 43
     }
44 44
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      *
48 48
      * @return string
49 49
      */
50
-    final protected function _getDir (): string {
50
+    final protected function _getDir(): string {
51 51
         return "organization_exports";
52 52
     }
53 53
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param Workspace $organization
56 56
      * @return $this
57 57
      */
58
-    public function create (Workspace $organization) {
58
+    public function create(Workspace $organization) {
59 59
         $this->_set('organization', $organization);
60 60
         return $this->_create();
61 61
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      *
66 66
      * @return bool
67 67
      */
68
-    final public function isActive (): bool {
68
+    final public function isActive(): bool {
69 69
         return $this->getState() === self::STATE_ACTIVE;
70 70
     }
71 71
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @return bool
76 76
      */
77
-    final public function isDone (): bool {
77
+    final public function isDone(): bool {
78 78
         return $this->isSuccessful() or $this->isFailed();
79 79
     }
80 80
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @return bool
85 85
      */
86
-    final public function isFailed (): bool {
86
+    final public function isFailed(): bool {
87 87
         return $this->getState() === self::STATE_FAIL;
88 88
     }
89 89
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @return bool
94 94
      */
95
-    final public function isQueued (): bool {
95
+    final public function isQueued(): bool {
96 96
         return $this->getState() === self::STATE_QUEUED;
97 97
     }
98 98
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      *
102 102
      * @return bool
103 103
      */
104
-    final public function isSuccessful (): bool {
104
+    final public function isSuccessful(): bool {
105 105
         return $this->getState() === self::STATE_SUCCESS;
106 106
     }
107 107
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @param callable $spinner `fn( OrganizationExport $this ): void`
114 114
      * @return $this
115 115
      */
116
-    public function wait (callable $spinner = null) {
116
+    public function wait(callable $spinner = null) {
117 117
         while (!$this->isDone()) {
118 118
             if ($spinner) {
119 119
                 call_user_func($spinner, $this);
Please login to merge, or discard this patch.
src/Event/Change.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected $key;
42 42
 
43
-    protected function _setData (array $data): void {
43
+    protected function _setData(array $data): void {
44 44
         $this->key = [
45 45
             Event::ACTION_ADDED => 'added_value',
46 46
             Event::ACTION_REMOVED => 'removed_value',
@@ -67,35 +67,35 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @return null|User|Project|Section|Task|FieldEntry|Attachment|Story|Like
69 69
      */
70
-    public function getPayload () {
70
+    public function getPayload() {
71 71
         return $this->data[$this->key];
72 72
     }
73 73
 
74 74
     /**
75 75
      * @return bool
76 76
      */
77
-    final public function hasPayload (): bool {
77
+    final public function hasPayload(): bool {
78 78
         return isset($this->data[$this->key]);
79 79
     }
80 80
 
81 81
     /**
82 82
      * @return bool
83 83
      */
84
-    final public function wasAddition (): bool {
84
+    final public function wasAddition(): bool {
85 85
         return $this->getAction() === Event::ACTION_ADDED;
86 86
     }
87 87
 
88 88
     /**
89 89
      * @return bool
90 90
      */
91
-    final public function wasRemoval (): bool {
91
+    final public function wasRemoval(): bool {
92 92
         return $this->getAction() === Event::ACTION_REMOVED;
93 93
     }
94 94
 
95 95
     /**
96 96
      * @return bool
97 97
      */
98
-    final public function wasValue (): bool {
98
+    final public function wasValue(): bool {
99 99
         return $this->getAction() === Event::ACTION_CHANGED;
100 100
     }
101 101
 
Please login to merge, or discard this patch.
src/Team.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return string
32 32
      */
33
-    final public function __toString (): string {
33
+    final public function __toString(): string {
34 34
         return "teams/{$this->getGid()}";
35 35
     }
36 36
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param User $user
39 39
      * @return $this
40 40
      */
41
-    public function addUser (User $user) {
41
+    public function addUser(User $user) {
42 42
         $this->api->post("{$this}/addUser", ['user' => $user->getGid()]);
43 43
         return $this;
44 44
     }
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
      * @param array $filter
52 52
      * @return Project[]
53 53
      */
54
-    public function getProjects (array $filter = Project::GET_ACTIVE) {
54
+    public function getProjects(array $filter = Project::GET_ACTIVE) {
55 55
         return $this->api->loadAll($this, Project::class, "{$this}/projects", $filter);
56 56
     }
57 57
 
58
-    public function getUrl (): string {
58
+    public function getUrl(): string {
59 59
         return "https://app.asana.com/0/{$this->getGid()}/overview";
60 60
     }
61 61
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @return User[]
68 68
      */
69
-    public function getUsers () {
69
+    public function getUsers() {
70 70
         return $this->api->loadAll($this, User::class, "{$this}/users");
71 71
     }
72 72
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @param User $user
75 75
      * @return $this
76 76
      */
77
-    public function removeUser (User $user) {
77
+    public function removeUser(User $user) {
78 78
         $this->api->post("{$this}/removeUser", ['user' => $user->getGid()]);
79 79
         return $this;
80 80
     }
Please login to merge, or discard this patch.
src/Tag.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      *
44 44
      * @return string
45 45
      */
46
-    final public function __toString (): string {
46
+    final public function __toString(): string {
47 47
         return "tags/{$this->getGid()}";
48 48
     }
49 49
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return string
54 54
      */
55
-    final protected function _getDir (): string {
55
+    final protected function _getDir(): string {
56 56
         return 'tags';
57 57
     }
58 58
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * @param array $filter
61 61
      * @return Traversable|Task[]
62 62
      */
63
-    public function getIterator (array $filter = Task::GET_INCOMPLETE) {
63
+    public function getIterator(array $filter = Task::GET_INCOMPLETE) {
64 64
         return $this->api->loadEach($this, Task::class, "{$this}/tasks", $filter);
65 65
     }
66 66
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param array $filter
69 69
      * @return Task[]
70 70
      */
71
-    public function getTasks (array $filter = Task::GET_INCOMPLETE) {
71
+    public function getTasks(array $filter = Task::GET_INCOMPLETE) {
72 72
         return iterator_to_array($this->getIterator($filter));
73 73
     }
74 74
 }
75 75
\ No newline at end of file
Please login to merge, or discard this patch.
src/Task.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      *
120 120
      * @return string
121 121
      */
122
-    final public function __toString (): string {
122
+    final public function __toString(): string {
123 123
         return "tasks/{$this->getGid()}";
124 124
     }
125 125
 
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
      *
129 129
      * @return string
130 130
      */
131
-    final protected function _getDir (): string {
131
+    final protected function _getDir(): string {
132 132
         return 'tasks';
133 133
     }
134 134
 
135
-    private function _onSave (): void {
135
+    private function _onSave(): void {
136 136
         /** @var FieldEntries $fields */
137 137
         if ($fields = $this->data['custom_fields'] ?? null) {
138 138
             $fields->__unset(true);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         }
144 144
     }
145 145
 
146
-    protected function _setData (array $data): void {
146
+    protected function _setData(array $data): void {
147 147
         // hearts were deprecated for likes
148 148
         unset($data['hearted'], $data['hearts'], $data['num_hearts']);
149 149
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      * @param string $file
164 164
      * @return Attachment
165 165
      */
166
-    public function addAttachment (string $file) {
166
+    public function addAttachment(string $file) {
167 167
         /** @var Attachment $attachment */
168 168
         $attachment = $this->api->factory($this, Attachment::class, ['parent' => $this]);
169 169
         return $attachment->upload($file);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      * @param string $text
177 177
      * @return Story
178 178
      */
179
-    public function addComment (string $text) {
179
+    public function addComment(string $text) {
180 180
         return $this->newComment()->setText($text)->create();
181 181
     }
182 182
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      * @param Task[] $tasks
188 188
      * @return $this
189 189
      */
190
-    public function addDependencies (array $tasks) {
190
+    public function addDependencies(array $tasks) {
191 191
         $this->api->post("{$this}/addDependencies", ['dependents' => array_column($tasks, 'gid')]);
192 192
         return $this;
193 193
     }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      * @param Task $task
200 200
      * @return $this
201 201
      */
202
-    public function addDependency (Task $task) {
202
+    public function addDependency(Task $task) {
203 203
         return $this->addDependencies([$task]);
204 204
     }
205 205
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      * @param Task $task
211 211
      * @return $this
212 212
      */
213
-    public function addDependent (Task $task) {
213
+    public function addDependent(Task $task) {
214 214
         return $this->addDependents([$task]);
215 215
     }
216 216
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      * @param Task[] $tasks
222 222
      * @return $this
223 223
      */
224
-    public function addDependents (array $tasks) {
224
+    public function addDependents(array $tasks) {
225 225
         $this->api->post("{$this}/addDependents", ['dependents' => array_column($tasks, 'gid')]);
226 226
         return $this;
227 227
     }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      * @param User $user
233 233
      * @return $this
234 234
      */
235
-    public function addFollower (User $user) {
235
+    public function addFollower(User $user) {
236 236
         return $this->addFollowers([$user]);
237 237
     }
238 238
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      * @param User[] $users
245 245
      * @return $this
246 246
      */
247
-    public function addFollowers (array $users) {
247
+    public function addFollowers(array $users) {
248 248
         return $this->_addWithPost("{$this}/addFollowers", [
249 249
             'followers' => array_column($users, 'gid')
250 250
         ], 'followers', $users);
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      * @param Tag $tag
259 259
      * @return $this
260 260
      */
261
-    public function addTag (Tag $tag) {
261
+    public function addTag(Tag $tag) {
262 262
         return $this->_addWithPost("{$this}/addTag", [
263 263
             'tag' => $tag->getGid()
264 264
         ], 'tags', [$tag]);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
      * @param Section $section
275 275
      * @return $this
276 276
      */
277
-    public function addToProject (Section $section) {
277
+    public function addToProject(Section $section) {
278 278
         /** @var Membership $membership */
279 279
         $membership = $this->api->factory($this, Membership::class)
280 280
             ->_set('project', $section->getProject())
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      * @param string $target
290 290
      * @return TaskWebhook
291 291
      */
292
-    public function addWebhook (string $target) {
292
+    public function addWebhook(string $target) {
293 293
         /** @var TaskWebhook $webhook */
294 294
         $webhook = $this->api->factory($this, TaskWebhook::class);
295 295
         return $webhook->create($this, $target);
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     /**
299 299
      * @return $this
300 300
      */
301
-    public function create () {
301
+    public function create() {
302 302
         $this->_create();
303 303
         $this->_onSave();
304 304
         return $this;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      * @param string[] $include
315 315
      * @return Job
316 316
      */
317
-    public function duplicate (string $name, array $include) {
317
+    public function duplicate(string $name, array $include) {
318 318
         /** @var array $remote */
319 319
         $remote = $this->api->post("{$this}/duplicate", [
320 320
             'name' => $name,
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      * @depends after-create
330 330
      * @return Attachment[]
331 331
      */
332
-    public function getAttachments () {
332
+    public function getAttachments() {
333 333
         return $this->api->loadAll($this, Attachment::class, "{$this}/attachments");
334 334
     }
335 335
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      * @depends after-create
338 338
      * @return Story[]
339 339
      */
340
-    public function getComments () {
340
+    public function getComments() {
341 341
         return $this->selectStories(function(Story $story) {
342 342
             return $story->isComment();
343 343
         });
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
      * @depends after-create
350 350
      * @return Task[]
351 351
      */
352
-    public function getDependencies () {
352
+    public function getDependencies() {
353 353
         return $this->api->loadAll($this, self::class, "{$this}/dependencies");
354 354
     }
355 355
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
      * @depends after-create
360 360
      * @return Task[]
361 361
      */
362
-    public function getDependents () {
362
+    public function getDependents() {
363 363
         return $this->api->loadAll($this, self::class, "{$this}/dependents");
364 364
     }
365 365
 
@@ -374,21 +374,21 @@  discard block
 block discarded – undo
374 374
      *
375 375
      * @return External
376 376
      */
377
-    public function getExternal () {
377
+    public function getExternal() {
378 378
         return $this->_get('external') ?? $this->data['external'] = $this->api->factory($this, External::class);
379 379
     }
380 380
 
381 381
     /**
382 382
      * @return Project[]
383 383
      */
384
-    public function getProjects () {
384
+    public function getProjects() {
385 385
         return array_column($this->getMemberships(), 'project');
386 386
     }
387 387
 
388 388
     /**
389 389
      * @return Section[]
390 390
      */
391
-    public function getSections () {
391
+    public function getSections() {
392 392
         return array_column($this->getMemberships(), 'section');
393 393
     }
394 394
 
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
      * @depends after-create
397 397
      * @return Story[]
398 398
      */
399
-    public function getStories () {
399
+    public function getStories() {
400 400
         return $this->api->loadAll($this, Story::class, "{$this}/stories");
401 401
     }
402 402
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      * @depends after-create
405 405
      * @return Task[]
406 406
      */
407
-    public function getSubTasks () {
407
+    public function getSubTasks() {
408 408
         return $this->api->loadAll($this, self::class, "{$this}/subtasks");
409 409
     }
410 410
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
      * @depends after-create
413 413
      * @return string
414 414
      */
415
-    public function getUrl (): string {
415
+    public function getUrl(): string {
416 416
         return "https://app.asana.com/0/0/{$this->getGid()}";
417 417
     }
418 418
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
      * @depends after-create
421 421
      * @return TaskWebhook[]
422 422
      */
423
-    public function getWebhooks () {
423
+    public function getWebhooks() {
424 424
         return $this->api->loadAll($this, TaskWebhook::class, 'webhooks', [
425 425
             'workspace' => $this->getWorkspace()->getGid(),
426 426
             'resource' => $this->getGid()
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      * @depends after-create
434 434
      * @return Story
435 435
      */
436
-    public function newComment () {
436
+    public function newComment() {
437 437
         return $this->api->factory($this, Story::class, [
438 438
             'resource_subtype' => Story::TYPE_COMMENT_ADDED,
439 439
             'target' => $this
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      * @depends after-create
447 447
      * @return Task
448 448
      */
449
-    public function newSubTask () {
449
+    public function newSubTask() {
450 450
         /** @var Task $sub */
451 451
         $sub = $this->api->factory($this, self::class);
452 452
         return $sub->setParent($this);
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
      * @param Task[] $tasks
460 460
      * @return $this
461 461
      */
462
-    public function removeDependencies (array $tasks) {
462
+    public function removeDependencies(array $tasks) {
463 463
         $this->api->post("{$this}/removeDependencies", ['dependencies' => array_column($tasks, 'gid')]);
464 464
         return $this;
465 465
     }
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
      * @param Task $task
472 472
      * @return $this
473 473
      */
474
-    public function removeDependency (Task $task) {
474
+    public function removeDependency(Task $task) {
475 475
         return $this->removeDependencies([$task]);
476 476
     }
477 477
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
      * @param Task $task
483 483
      * @return $this
484 484
      */
485
-    public function removeDependent (Task $task) {
485
+    public function removeDependent(Task $task) {
486 486
         return $this->removeDependents([$task]);
487 487
     }
488 488
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
      * @param Task[] $tasks
494 494
      * @return $this
495 495
      */
496
-    public function removeDependents (array $tasks) {
496
+    public function removeDependents(array $tasks) {
497 497
         $this->api->post("{$this}/removeDependents", ['dependents' => array_column($tasks, 'gid')]);
498 498
         return $this;
499 499
     }
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
      * @param User $user
505 505
      * @return $this
506 506
      */
507
-    public function removeFollower (User $user) {
507
+    public function removeFollower(User $user) {
508 508
         return $this->removeFollowers([$user]);
509 509
     }
510 510
 
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
      * @param User[] $users
517 517
      * @return $this
518 518
      */
519
-    public function removeFollowers (array $users) {
519
+    public function removeFollowers(array $users) {
520 520
         return $this->_removeWithPost("{$this}/removeFollowers", [
521 521
             'followers' => array_column($users, 'gid')
522 522
         ], 'followers', $users);
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
      * @param Project $project
531 531
      * @return $this
532 532
      */
533
-    public function removeFromProject (Project $project) {
533
+    public function removeFromProject(Project $project) {
534 534
         return $this->_removeWithPost("{$this}/removeProject", [
535 535
             'project' => $project->getGid()
536 536
         ], 'memberships', function(Membership $membership) use ($project) {
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
      * @param Tag $tag
547 547
      * @return $this
548 548
      */
549
-    public function removeTag (Tag $tag) {
549
+    public function removeTag(Tag $tag) {
550 550
         return $this->_removeWithPost("{$this}/removeTag", [
551 551
             'tag' => $tag->getGid()
552 552
         ], 'tags', [$tag]);
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
      * @param null|Task $parent
560 560
      * @return $this
561 561
      */
562
-    public function setParent (?self $parent) {
562
+    public function setParent(?self $parent) {
563 563
         return $this->_setWithPost("{$this}/setParent", [
564 564
             'parent' => $parent
565 565
         ], 'parent', $parent);
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
     /**
569 569
      * @return $this
570 570
      */
571
-    public function update () {
571
+    public function update() {
572 572
         $this->_update();
573 573
         $this->_onSave();
574 574
         return $this;
Please login to merge, or discard this patch.
src/Project.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      *
95 95
      * @return string
96 96
      */
97
-    final public function __toString (): string {
97
+    final public function __toString(): string {
98 98
         return "projects/{$this->getGid()}";
99 99
     }
100 100
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * @return string
105 105
      */
106
-    final protected function _getDir (): string {
106
+    final protected function _getDir(): string {
107 107
         return 'projects';
108 108
     }
109 109
 
110
-    protected function _setData (array $data): void {
110
+    protected function _setData(array $data): void {
111 111
         // this is always empty. fields are in the settings, values are in tasks.
112 112
         unset($data['custom_fields']);
113 113
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      * @param User $user
123 123
      * @return $this
124 124
      */
125
-    public function addMember (User $user) {
125
+    public function addMember(User $user) {
126 126
         return $this->addMembers([$user]);
127 127
     }
128 128
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      * @param User[] $users
132 132
      * @return $this
133 133
      */
134
-    public function addMembers (array $users) {
134
+    public function addMembers(array $users) {
135 135
         return $this->_addWithPost("{$this}/addMembers", [
136 136
             'members' => array_column($users, 'gid')
137 137
         ], 'members', $users);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @param string $target
143 143
      * @return ProjectWebhook
144 144
      */
145
-    public function addWebhook (string $target) {
145
+    public function addWebhook(string $target) {
146 146
         /** @var ProjectWebhook $webhook */
147 147
         $webhook = $this->api->factory($this, ProjectWebhook::class);
148 148
         return $webhook->create($this, $target);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      * @param array $schedule
168 168
      * @return Job
169 169
      */
170
-    public function duplicate (string $name, array $include, Team $team = null, array $schedule = []) {
170
+    public function duplicate(string $name, array $include, Team $team = null, array $schedule = []) {
171 171
         $data = ['name' => $name];
172 172
         if ($team) {
173 173
             $data['team'] = $team->getGid();
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      * @depends after-create
188 188
      * @return Section
189 189
      */
190
-    public function getDefaultSection () {
190
+    public function getDefaultSection() {
191 191
         return $this->defaultSection ?? $this->defaultSection = $this->getSections(1)[0];
192 192
     }
193 193
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      * @param int $limit
200 200
      * @return Traversable|Section[]
201 201
      */
202
-    public function getIterator (int $limit = PHP_INT_MAX) {
202
+    public function getIterator(int $limit = PHP_INT_MAX) {
203 203
         return $this->api->loadEach($this, Section::class, "{$this}/sections", ['limit' => $limit]);
204 204
     }
205 205
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      * @param int $limit
209 209
      * @return Section[]
210 210
      */
211
-    public function getSections (int $limit = PHP_INT_MAX) {
211
+    public function getSections(int $limit = PHP_INT_MAX) {
212 212
         return iterator_to_array($this->getIterator($limit));
213 213
     }
214 214
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      * @depends after-create
217 217
      * @return Status[]
218 218
      */
219
-    public function getStatuses () {
219
+    public function getStatuses() {
220 220
         return $this->api->loadAll($this, Status::class, "{$this}/project_statuses");
221 221
     }
222 222
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
      * @depends after-create
225 225
      * @return TaskCounts
226 226
      */
227
-    public function getTaskCounts () {
227
+    public function getTaskCounts() {
228 228
         /** @var array $remote */
229 229
         $remote = $this->api->get("{$this}/task_counts", [], TaskCounts::OPT);
230 230
         return $this->api->factory($this, TaskCounts::class, $remote);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
      * @param array $filter
238 238
      * @return Task[]
239 239
      */
240
-    public function getTasks (array $filter = Task::GET_INCOMPLETE) {
240
+    public function getTasks(array $filter = Task::GET_INCOMPLETE) {
241 241
         $filter['project'] = $this->getGid();
242 242
         return $this->api->loadAll($this, Task::class, "tasks", $filter);
243 243
     }
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
      * @depends after-create
247 247
      * @return string
248 248
      */
249
-    public function getUrl (): string {
249
+    public function getUrl(): string {
250 250
         return "https://app.asana.com/0/{$this->getGid()}";
251 251
     }
252 252
 
253 253
     /**
254 254
      * @return ProjectWebhook[]
255 255
      */
256
-    public function getWebhooks () {
256
+    public function getWebhooks() {
257 257
         return $this->api->loadAll($this, ProjectWebhook::class, 'webhooks', [
258 258
             'workspace' => $this->getWorkspace()->getGid(),
259 259
             'resource' => $this->getGid()
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
     /**
264 264
      * @return bool
265 265
      */
266
-    final public function isBoard (): bool {
266
+    final public function isBoard(): bool {
267 267
         return $this->getLayout() === self::LAYOUT_BOARD;
268 268
     }
269 269
 
270 270
     /**
271 271
      * @return bool
272 272
      */
273
-    final public function isList (): bool {
273
+    final public function isList(): bool {
274 274
         return $this->getLayout() === self::LAYOUT_LIST;
275 275
     }
276 276
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      * @depends after-create
281 281
      * @return Section
282 282
      */
283
-    public function newSection () {
283
+    public function newSection() {
284 284
         return $this->api->factory($this, Section::class, ['project' => $this]);
285 285
     }
286 286
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      * @depends after-create
291 291
      * @return Status
292 292
      */
293
-    public function newStatus () {
293
+    public function newStatus() {
294 294
         return $this->api->factory($this, Status::class);
295 295
     }
296 296
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      * @depends after-create
301 301
      * @return Task
302 302
      */
303
-    public function newTask () {
303
+    public function newTask() {
304 304
         return $this->getDefaultSection()->newTask();
305 305
     }
306 306
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      * @param User $user
310 310
      * @return $this
311 311
      */
312
-    public function removeMember (User $user) {
312
+    public function removeMember(User $user) {
313 313
         return $this->removeMembers([$user]);
314 314
     }
315 315
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      * @param User[] $users
319 319
      * @return $this
320 320
      */
321
-    public function removeMembers (array $users) {
321
+    public function removeMembers(array $users) {
322 322
         return $this->_removeWithPost("{$this}/removeMembers", [
323 323
             'members' => array_column($users, 'gid')
324 324
         ], 'members', $users);
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      * @param null|Team $team
330 330
      * @return $this
331 331
      */
332
-    public function setTeam (?Team $team) {
332
+    public function setTeam(?Team $team) {
333 333
         if ($team and !$this->hasWorkspace()) {
334 334
             $this->setWorkspace($team->getOrganization());
335 335
         }
Please login to merge, or discard this patch.