@@ -45,31 +45,31 @@ discard block |
||
45 | 45 | 'task' => Task::class |
46 | 46 | ]; |
47 | 47 | |
48 | - final public function __toString (): string { |
|
48 | + final public function __toString(): string { |
|
49 | 49 | return "stories/{$this->getGid()}"; |
50 | 50 | } |
51 | 51 | |
52 | - final protected function _getDir (): string { |
|
52 | + final protected function _getDir(): string { |
|
53 | 53 | return "{$this->getTask()}/stories"; |
54 | 54 | } |
55 | 55 | |
56 | - final public function isAssignment (): bool { |
|
56 | + final public function isAssignment(): bool { |
|
57 | 57 | return $this->getResourceSubtype() === self::TYPE_ASSIGNED; |
58 | 58 | } |
59 | 59 | |
60 | - final public function isComment (): bool { |
|
60 | + final public function isComment(): bool { |
|
61 | 61 | return $this->getResourceSubtype() === self::TYPE_COMMENT_ADDED; |
62 | 62 | } |
63 | 63 | |
64 | - final public function isDueDate (): bool { |
|
64 | + final public function isDueDate(): bool { |
|
65 | 65 | return $this->getResourceSubtype() === self::TYPE_DUE_DATE_CHANGED; |
66 | 66 | } |
67 | 67 | |
68 | - public function isEdited (): bool { |
|
68 | + public function isEdited(): bool { |
|
69 | 69 | return $this->_is('is_edited'); |
70 | 70 | } |
71 | 71 | |
72 | - public function isPinned (): bool { |
|
72 | + public function isPinned(): bool { |
|
73 | 73 | return $this->_is('is_pinned'); |
74 | 74 | } |
75 | 75 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param bool $pinned |
78 | 78 | * @return $this |
79 | 79 | */ |
80 | - public function setPinned (bool $pinned) { |
|
80 | + public function setPinned(bool $pinned) { |
|
81 | 81 | return $this->_set('is_pinned', $pinned); |
82 | 82 | } |
83 | 83 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'user' => User::class |
17 | 17 | ]; |
18 | 18 | |
19 | - protected function _setData (array $data): void { |
|
19 | + protected function _setData(array $data): void { |
|
20 | 20 | unset($data['gid']); // useless, likes aren't entities. |
21 | 21 | parent::_setData($data); |
22 | 22 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | 'parent' => Task::class |
33 | 33 | ]; |
34 | 34 | |
35 | - final public function __toString (): string { |
|
35 | + final public function __toString(): string { |
|
36 | 36 | return "attachments/{$this->getGid()}"; |
37 | 37 | } |
38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param string $file |
45 | 45 | * @return $this |
46 | 46 | */ |
47 | - public function upload (string $file) { |
|
47 | + public function upload(string $file) { |
|
48 | 48 | // api returns compact version. reload. |
49 | 49 | /** @var array $remote */ |
50 | 50 | $remote = $this->api->upload("{$this->getParent()}/attachments", $file); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | protected $task; |
26 | 26 | |
27 | - public function __construct (Task $task, array $data = []) { |
|
27 | + public function __construct(Task $task, array $data = []) { |
|
28 | 28 | parent::__construct($task, $data); |
29 | 29 | $this->task = $task; |
30 | 30 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param mixed $value |
37 | 37 | * @return $this |
38 | 38 | */ |
39 | - protected function _set (string $field, $value) { |
|
39 | + protected function _set(string $field, $value) { |
|
40 | 40 | $this->task->diff['external'] = true; |
41 | 41 | return parent::_set($field, $value); |
42 | 42 | } |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | 'workspace' => Workspace::class |
31 | 31 | ]; |
32 | 32 | |
33 | - final public function __toString (): string { |
|
33 | + final public function __toString(): string { |
|
34 | 34 | return "user_task_lists/{$this->getGid()}"; |
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @return Task[] |
39 | 39 | */ |
40 | - public function getIncompleteTasks () { |
|
40 | + public function getIncompleteTasks() { |
|
41 | 41 | return $this->getTasks(['completed_since' => 'now']); |
42 | 42 | } |
43 | 43 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return ArrayIterator|Task[] |
48 | 48 | */ |
49 | - public function getIterator () { |
|
49 | + public function getIterator() { |
|
50 | 50 | return new ArrayIterator($this->getTasks()); |
51 | 51 | } |
52 | 52 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param array $filter |
59 | 59 | * @return Task[] |
60 | 60 | */ |
61 | - public function getTasks (array $filter = []) { |
|
61 | + public function getTasks(array $filter = []) { |
|
62 | 62 | return $this->loadAll(Task::class, "{$this}/tasks", $filter); |
63 | 63 | } |
64 | 64 | } |
65 | 65 | \ No newline at end of file |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | 'enum_options' => [EnumOption::class], |
41 | 41 | ]; |
42 | 42 | |
43 | - final public function __toString (): string { |
|
43 | + final public function __toString(): string { |
|
44 | 44 | return "custom_fields/{$this->getGid()}"; |
45 | 45 | } |
46 | 46 | |
47 | - final protected function _getDir (): string { |
|
47 | + final protected function _getDir(): string { |
|
48 | 48 | return 'custom_fields'; |
49 | 49 | } |
50 | 50 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param string $name |
57 | 57 | * @return EnumOption |
58 | 58 | */ |
59 | - public function addEnumOption (string $name) { |
|
59 | + public function addEnumOption(string $name) { |
|
60 | 60 | /** @var EnumOption $option */ |
61 | 61 | $option = $this->factory(EnumOption::class); |
62 | 62 | $option->setName($name); |
@@ -72,35 +72,35 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * @return bool |
74 | 74 | */ |
75 | - public function hasNotificationsEnabled (): bool { |
|
75 | + public function hasNotificationsEnabled(): bool { |
|
76 | 76 | return $this->_is('has_notifications_enabled'); |
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | 80 | * @return bool |
81 | 81 | */ |
82 | - public function isEnum (): bool { |
|
82 | + public function isEnum(): bool { |
|
83 | 83 | return $this->getResourceSubtype() === self::TYPE_ENUM; |
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | 87 | * @return bool |
88 | 88 | */ |
89 | - public function isGlobalToWorkspace (): bool { |
|
89 | + public function isGlobalToWorkspace(): bool { |
|
90 | 90 | return $this->_is('is_global_to_workspace'); |
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | 94 | * @return bool |
95 | 95 | */ |
96 | - final public function isNumber (): bool { |
|
96 | + final public function isNumber(): bool { |
|
97 | 97 | return $this->getResourceSubtype() === self::TYPE_NUMBER; |
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
101 | 101 | * @return bool |
102 | 102 | */ |
103 | - final public function isText (): bool { |
|
103 | + final public function isText(): bool { |
|
104 | 104 | return $this->getResourceSubtype() === self::TYPE_TEXT; |
105 | 105 | } |
106 | 106 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @param bool $flag |
109 | 109 | * @return $this |
110 | 110 | */ |
111 | - public function setGlobalToWorkspace (bool $flag) { |
|
111 | + public function setGlobalToWorkspace(bool $flag) { |
|
112 | 112 | return $this->_set('is_global_to_workspace', $flag); |
113 | 113 | } |
114 | 114 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @param bool $flag |
117 | 117 | * @return $this |
118 | 118 | */ |
119 | - public function setNotificationsEnabled (bool $flag) { |
|
119 | + public function setNotificationsEnabled(bool $flag) { |
|
120 | 120 | return $this->_set('has_notifications_enabled', $flag); |
121 | 121 | } |
122 | 122 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @param callable $cmp `fn( EnumOption $a, EnumOption $b ): int` |
125 | 125 | * @return $this |
126 | 126 | */ |
127 | - public function sortEnumOptions (callable $cmp) { |
|
127 | + public function sortEnumOptions(callable $cmp) { |
|
128 | 128 | if ($options = $this->getEnumOptions()) { |
129 | 129 | $prev = $options[0]; // first option on remote |
130 | 130 | usort($options, $cmp); |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | 'workspace' => Workspace::class |
40 | 40 | ]; |
41 | 41 | |
42 | - final public function __toString (): string { |
|
42 | + final public function __toString(): string { |
|
43 | 43 | return "portfolios/{$this->getGid()}"; |
44 | 44 | } |
45 | 45 | |
46 | - final protected function _getDir (): string { |
|
46 | + final protected function _getDir(): string { |
|
47 | 47 | return 'portfolios'; |
48 | 48 | } |
49 | 49 | |
@@ -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 | return $this->_addWithPost("{$this}/addMembers", [ |
74 | 74 | 'members' => array_column($users, 'gid') |
75 | 75 | ], 'members', $users); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @depends after-create |
80 | 80 | * @return Project[] |
81 | 81 | */ |
82 | - public function getItems () { |
|
82 | + public function getItems() { |
|
83 | 83 | return $this->loadAll(Project::class, "{$this}/items"); |
84 | 84 | } |
85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @param Project $item |
89 | 89 | * @return $this |
90 | 90 | */ |
91 | - public function removeItem (Project $item) { |
|
91 | + public function removeItem(Project $item) { |
|
92 | 92 | $this->api->post("{$this}/removeItem", ['item' => $item->getGid()]); |
93 | 93 | return $this; |
94 | 94 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param User $user |
98 | 98 | * @return $this |
99 | 99 | */ |
100 | - public function removeMember (User $user) { |
|
100 | + public function removeMember(User $user) { |
|
101 | 101 | return $this->removeMembers([$user]); |
102 | 102 | } |
103 | 103 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param User[] $users |
106 | 106 | * @return $this |
107 | 107 | */ |
108 | - public function removeMembers (array $users) { |
|
108 | + public function removeMembers(array $users) { |
|
109 | 109 | return $this->_removeWithPost("{$this}/removeMembers", [ |
110 | 110 | 'members' => array_column($users, 'gid') |
111 | 111 | ], 'members', $users); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'organization' => Workspace::class |
26 | 26 | ]; |
27 | 27 | |
28 | - final public function __toString (): string { |
|
28 | + final public function __toString(): string { |
|
29 | 29 | return "teams/{$this->getGid()}"; |
30 | 30 | } |
31 | 31 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param User $user |
34 | 34 | * @return $this |
35 | 35 | */ |
36 | - public function addUser (User $user) { |
|
36 | + public function addUser(User $user) { |
|
37 | 37 | $this->api->post("{$this}/addUser", ['user' => $user->getGid()]); |
38 | 38 | return $this; |
39 | 39 | } |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | * @param array $filter |
47 | 47 | * @return Project[] |
48 | 48 | */ |
49 | - public function getProjects (array $filter = ['archived' => false]) { |
|
49 | + public function getProjects(array $filter = ['archived' => false]) { |
|
50 | 50 | return $this->loadAll(Project::class, "{$this}/projects", $filter); |
51 | 51 | } |
52 | 52 | |
53 | - public function getUrl (): string { |
|
53 | + public function getUrl(): string { |
|
54 | 54 | return "https://app.asana.com/0/{$this->getGid()}/overview"; |
55 | 55 | } |
56 | 56 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @return User[] |
63 | 63 | */ |
64 | - public function getUsers () { |
|
64 | + public function getUsers() { |
|
65 | 65 | return $this->loadAll(User::class, "{$this}/users"); |
66 | 66 | } |
67 | 67 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param User $user |
70 | 70 | * @return $this |
71 | 71 | */ |
72 | - public function removeUser (User $user) { |
|
72 | + public function removeUser(User $user) { |
|
73 | 73 | $this->api->post("{$this}/removeUser", ['user' => $user->getGid()]); |
74 | 74 | return $this; |
75 | 75 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | 'project' => Project::class |
29 | 29 | ]; |
30 | 30 | |
31 | - final public function __toString (): string { |
|
31 | + final public function __toString(): string { |
|
32 | 32 | return "sections/{$this->getGid()}"; |
33 | 33 | } |
34 | 34 | |
35 | - final protected function _getDir (): string { |
|
35 | + final protected function _getDir(): string { |
|
36 | 36 | return "{$this->getProject()}/sections"; |
37 | 37 | } |
38 | 38 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return Task[] |
45 | 45 | */ |
46 | - public function getTasks () { |
|
46 | + public function getTasks() { |
|
47 | 47 | return $this->loadAll(Task::class, 'tasks', ['section' => $this->getGid()]); |
48 | 48 | } |
49 | 49 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @depends after-create |
54 | 54 | * @return Task |
55 | 55 | */ |
56 | - public function newTask () { |
|
56 | + public function newTask() { |
|
57 | 57 | /** @var Task $task */ |
58 | 58 | $task = $this->factory(Task::class); |
59 | 59 | return $task->addToProject($this->getProject(), $this); |