@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | protected $types = []; |
47 | 47 | |
48 | - public function __construct (Task $task, array $data = []) { |
|
48 | + public function __construct(Task $task, array $data = []) { |
|
49 | 49 | $this->task = $task; |
50 | 50 | parent::__construct($task, $data); |
51 | 51 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @param array $data |
57 | 57 | */ |
58 | - protected function _setData (array $data): void { |
|
58 | + protected function _setData(array $data): void { |
|
59 | 59 | $this->index = []; |
60 | 60 | $this->optionNames = []; |
61 | 61 | $keys = array_flip(['gid', 'name', 'type', 'enum_options', 'enum_value', 'text_value', 'number_value']); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * @return int |
79 | 79 | */ |
80 | - public function count () { |
|
80 | + public function count() { |
|
81 | 81 | return count($this->data); |
82 | 82 | } |
83 | 83 | |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | * @param string $enumGid |
86 | 86 | * @return null|string |
87 | 87 | */ |
88 | - public function getCurrentOptionName (string $enumGid): ?string { |
|
88 | + public function getCurrentOptionName(string $enumGid): ?string { |
|
89 | 89 | return $this->getOptionName($enumGid, $this[$enumGid]); |
90 | 90 | } |
91 | 91 | |
92 | - public function getDiff (): array { |
|
92 | + public function getDiff(): array { |
|
93 | 93 | $diff = []; |
94 | 94 | foreach (array_keys($this->diff) as $index) { |
95 | 95 | $gid = $this->index[$index]; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * @return Generator |
103 | 103 | */ |
104 | - public function getIterator () { |
|
104 | + public function getIterator() { |
|
105 | 105 | foreach (array_keys($this->index) as $gid) { |
106 | 106 | yield $gid => $this[$gid]; |
107 | 107 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @param string $fieldGid |
112 | 112 | * @return null|string |
113 | 113 | */ |
114 | - public function getName (string $fieldGid): ?string { |
|
114 | + public function getName(string $fieldGid): ?string { |
|
115 | 115 | return $this->data[$this->index[$fieldGid]]['name']; |
116 | 116 | } |
117 | 117 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @return string[] |
122 | 122 | */ |
123 | - public function getNames () { |
|
123 | + public function getNames() { |
|
124 | 124 | return array_column($this->data, 'name', 'gid'); |
125 | 125 | } |
126 | 126 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @param string $optionGid |
130 | 130 | * @return null|string |
131 | 131 | */ |
132 | - public function getOptionName (string $enumGid, string $optionGid): ?string { |
|
132 | + public function getOptionName(string $enumGid, string $optionGid): ?string { |
|
133 | 133 | return $this->optionNames[$enumGid][$optionGid]; |
134 | 134 | } |
135 | 135 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * @param string $enumGid |
140 | 140 | * @return string[] |
141 | 141 | */ |
142 | - public function getOptionNames (string $enumGid) { |
|
142 | + public function getOptionNames(string $enumGid) { |
|
143 | 143 | return $this->optionNames[$enumGid]; |
144 | 144 | } |
145 | 145 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @param string $fieldGid |
148 | 148 | * @return null|number|string |
149 | 149 | */ |
150 | - public function getValue (string $fieldGid) { |
|
150 | + public function getValue(string $fieldGid) { |
|
151 | 151 | $field = $this->data[$this->index[$fieldGid]]; |
152 | 152 | if ($field['type'] === CustomField::TYPE_ENUM) { |
153 | 153 | return $field['enum_value']['gid']; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param string $fieldGid |
160 | 160 | * @return bool |
161 | 161 | */ |
162 | - public function offsetExists ($fieldGid) { |
|
162 | + public function offsetExists($fieldGid) { |
|
163 | 163 | return array_key_exists($this->index[$fieldGid], $this->data); |
164 | 164 | } |
165 | 165 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @param string $fieldGid |
168 | 168 | * @return null|number|string |
169 | 169 | */ |
170 | - public function offsetGet ($fieldGid) { |
|
170 | + public function offsetGet($fieldGid) { |
|
171 | 171 | return $this->getValue($fieldGid); |
172 | 172 | } |
173 | 173 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * @param string $fieldGid |
176 | 176 | * @param null|number|string $value |
177 | 177 | */ |
178 | - public function offsetSet ($fieldGid, $value) { |
|
178 | + public function offsetSet($fieldGid, $value) { |
|
179 | 179 | $this->setValue($fieldGid, $value); |
180 | 180 | } |
181 | 181 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @param string $fieldGid |
186 | 186 | */ |
187 | - public function offsetUnset ($fieldGid) { |
|
187 | + public function offsetUnset($fieldGid) { |
|
188 | 188 | $this->setValue($fieldGid, null); |
189 | 189 | } |
190 | 190 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * @param null|number|string $value |
194 | 194 | * @return $this |
195 | 195 | */ |
196 | - public function setValue (string $fieldGid, $value) { |
|
196 | + public function setValue(string $fieldGid, $value) { |
|
197 | 197 | $i = $this->index[$fieldGid]; |
198 | 198 | $type = $this->data[$i]['type']; |
199 | 199 | if ($type === CustomField::TYPE_ENUM) { |
@@ -198,8 +198,7 @@ |
||
198 | 198 | $type = $this->data[$i]['type']; |
199 | 199 | if ($type === CustomField::TYPE_ENUM) { |
200 | 200 | $this->data[$i]['enum_value']['gid'] = $value; |
201 | - } |
|
202 | - else { |
|
201 | + } else { |
|
203 | 202 | $this->data["{$type}_value"] = $value; |
204 | 203 | } |
205 | 204 | $this->diff[$i] = true; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | 'custom_field' => CustomField::class, |
20 | 20 | ]; |
21 | 21 | |
22 | - protected function _setData (array $data): void { |
|
22 | + protected function _setData(array $data): void { |
|
23 | 23 | // useless, settings aren't entities |
24 | 24 | unset($data['gid'], $data['resource_type']); |
25 | 25 | // deprecated |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | parent::_setData($data); |
30 | 30 | } |
31 | 31 | |
32 | - final public function getResourceType (): string { |
|
32 | + final public function getResourceType(): string { |
|
33 | 33 | return self::TYPE; |
34 | 34 | } |
35 | 35 | } |
36 | 36 | \ No newline at end of file |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * @return CustomField[] |
17 | 17 | */ |
18 | - public function getCustomFields () { |
|
18 | + public function getCustomFields() { |
|
19 | 19 | return array_map(function(FieldSetting $setting) { |
20 | 20 | return $setting->getCustomField(); |
21 | 21 | }, $this->getCustomFieldSettings()); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param callable $filter `fn( CustomField $field ): bool` |
26 | 26 | * @return CustomField[] |
27 | 27 | */ |
28 | - public function selectCustomFields (callable $filter) { |
|
28 | + public function selectCustomFields(callable $filter) { |
|
29 | 29 | return $this->{'_select'}($this->getCustomFields(), $filter); |
30 | 30 | } |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | 'organization' => Workspace::class |
34 | 34 | ]; |
35 | 35 | |
36 | - final public function __toString (): string { |
|
36 | + final public function __toString(): string { |
|
37 | 37 | return "organization_exports/{$this->getGid()}"; |
38 | 38 | } |
39 | 39 | |
40 | - final protected function _getDir (): string { |
|
40 | + final protected function _getDir(): string { |
|
41 | 41 | return "organization_exports"; |
42 | 42 | } |
43 | 43 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param Workspace $organization |
46 | 46 | * @return $this |
47 | 47 | */ |
48 | - public function create (Workspace $organization) { |
|
48 | + public function create(Workspace $organization) { |
|
49 | 49 | $this->_set('organization', $organization); |
50 | 50 | return $this->_create(); |
51 | 51 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return bool |
57 | 57 | */ |
58 | - final public function isActive (): bool { |
|
58 | + final public function isActive(): bool { |
|
59 | 59 | return $this->getState() === self::STATE_ACTIVE; |
60 | 60 | } |
61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return bool |
66 | 66 | */ |
67 | - final public function isDone (): bool { |
|
67 | + final public function isDone(): bool { |
|
68 | 68 | return $this->isSuccessful() or $this->isFailed(); |
69 | 69 | } |
70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return bool |
75 | 75 | */ |
76 | - final public function isFailed (): bool { |
|
76 | + final public function isFailed(): bool { |
|
77 | 77 | return $this->getState() === self::STATE_FAIL; |
78 | 78 | } |
79 | 79 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @return bool |
84 | 84 | */ |
85 | - final public function isQueued (): bool { |
|
85 | + final public function isQueued(): bool { |
|
86 | 86 | return $this->getState() === self::STATE_QUEUED; |
87 | 87 | } |
88 | 88 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return bool |
93 | 93 | */ |
94 | - final public function isSuccessful (): bool { |
|
94 | + final public function isSuccessful(): bool { |
|
95 | 95 | return $this->getState() === self::STATE_SUCCESS; |
96 | 96 | } |
97 | 97 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param callable $spinner `fn( OrganizationExport $this ): void` |
104 | 104 | * @return $this |
105 | 105 | */ |
106 | - public function wait (callable $spinner = null) { |
|
106 | + public function wait(callable $spinner = null) { |
|
107 | 107 | while (!$this->isDone()) { |
108 | 108 | if ($spinner) { |
109 | 109 | call_user_func($spinner, $this); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'new_task' => Task::class |
34 | 34 | ]; |
35 | 35 | |
36 | - final public function __toString (): string { |
|
36 | + final public function __toString(): string { |
|
37 | 37 | return "jobs/{$this->getGid()}"; |
38 | 38 | } |
39 | 39 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return bool |
44 | 44 | */ |
45 | - public function isActive (): bool { |
|
45 | + public function isActive(): bool { |
|
46 | 46 | return $this->getStatus() === self::STATUS_ACTIVE; |
47 | 47 | } |
48 | 48 | |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | * |
52 | 52 | * @return bool |
53 | 53 | */ |
54 | - public function isDone (): bool { |
|
54 | + public function isDone(): bool { |
|
55 | 55 | return $this->isSuccessful() or $this->isFailed(); |
56 | 56 | } |
57 | 57 | |
58 | - final public function isDuplicatingProject (): bool { |
|
58 | + final public function isDuplicatingProject(): bool { |
|
59 | 59 | return $this->getResourceSubtype() === self::TYPE_DUPLICATE_PROJECT; |
60 | 60 | } |
61 | 61 | |
62 | - final public function isDuplicatingTask (): bool { |
|
62 | + final public function isDuplicatingTask(): bool { |
|
63 | 63 | return $this->getResourceSubtype() === self::TYPE_DUPLICATE_TASK; |
64 | 64 | } |
65 | 65 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return bool |
70 | 70 | */ |
71 | - public function isFailed (): bool { |
|
71 | + public function isFailed(): bool { |
|
72 | 72 | return $this->getStatus() === self::STATUS_FAIL; |
73 | 73 | } |
74 | 74 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @return bool |
79 | 79 | */ |
80 | - public function isQueued (): bool { |
|
80 | + public function isQueued(): bool { |
|
81 | 81 | return $this->getStatus() === self::STATUS_QUEUED; |
82 | 82 | } |
83 | 83 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return bool |
88 | 88 | */ |
89 | - public function isSuccessful (): bool { |
|
89 | + public function isSuccessful(): bool { |
|
90 | 90 | return $this->getStatus() === self::STATUS_SUCCESS; |
91 | 91 | } |
92 | 92 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @param callable $spinner `fn( Job $this ): void` |
99 | 99 | * @return $this |
100 | 100 | */ |
101 | - public function wait (callable $spinner = null) { |
|
101 | + public function wait(callable $spinner = null) { |
|
102 | 102 | while (!$this->isDone()) { |
103 | 103 | if ($spinner) { |
104 | 104 | call_user_func($spinner, $this); |
@@ -50,20 +50,20 @@ discard block |
||
50 | 50 | * @param Project $project |
51 | 51 | * @param array $data |
52 | 52 | */ |
53 | - public function __construct (Project $project, array $data = []) { |
|
53 | + public function __construct(Project $project, array $data = []) { |
|
54 | 54 | parent::__construct($project, $data); |
55 | 55 | $this->project = $project; |
56 | 56 | } |
57 | 57 | |
58 | - final public function __toString (): string { |
|
58 | + final public function __toString(): string { |
|
59 | 59 | return "project_statuses/{$this->getGid()}"; |
60 | 60 | } |
61 | 61 | |
62 | - final protected function _getDir (): string { |
|
62 | + final protected function _getDir(): string { |
|
63 | 63 | return "{$this->project}/project_statuses"; |
64 | 64 | } |
65 | 65 | |
66 | - protected function _setData (array $data): void { |
|
66 | + protected function _setData(array $data): void { |
|
67 | 67 | // redundant, prefer created_by |
68 | 68 | unset($data['author']); |
69 | 69 | parent::_setData($data); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * @return Project |
74 | 74 | */ |
75 | - public function getProject () { |
|
75 | + public function getProject() { |
|
76 | 76 | return $this->project; |
77 | 77 | } |
78 | 78 | } |
79 | 79 | \ No newline at end of file |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | const TYPE = 'workspace'; |
29 | 29 | |
30 | - final public function __toString (): string { |
|
30 | + final public function __toString(): string { |
|
31 | 31 | return "workspaces/{$this->getGid()}"; |
32 | 32 | } |
33 | 33 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return OrganizationExport |
38 | 38 | */ |
39 | - public function export () { |
|
39 | + public function export() { |
|
40 | 40 | /** @var OrganizationExport $export */ |
41 | 41 | $export = $this->_factory(OrganizationExport::class); |
42 | 42 | return $export->create($this); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param int $limit 1-100 |
57 | 57 | * @return array|AbstractEntity[] |
58 | 58 | */ |
59 | - protected function find (string $class, string $text, int $limit = 20) { |
|
59 | + protected function find(string $class, string $text, int $limit = 20) { |
|
60 | 60 | return $this->_loadAll($class, "{$this}/typeahead", [ |
61 | 61 | 'resource_type' => $class::TYPE, |
62 | 62 | 'query' => $text, |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * @param int $limit 1-100 |
72 | 72 | * @return CustomField[] |
73 | 73 | */ |
74 | - public function findCustomFields (string $text, int $limit = 20) { |
|
74 | + public function findCustomFields(string $text, int $limit = 20) { |
|
75 | 75 | return $this->find(CustomField::class, $text, $limit); |
76 | 76 | } |
77 | 77 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param int $limit 1-100 |
83 | 83 | * @return Portfolio[] |
84 | 84 | */ |
85 | - public function findPortfolios (string $text, int $limit = 20) { |
|
85 | + public function findPortfolios(string $text, int $limit = 20) { |
|
86 | 86 | return $this->find(Portfolio::class, $text, $limit); |
87 | 87 | } |
88 | 88 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param int $limit 1-100 |
94 | 94 | * @return Project[] |
95 | 95 | */ |
96 | - public function findProjects (string $text, int $limit = 20) { |
|
96 | + public function findProjects(string $text, int $limit = 20) { |
|
97 | 97 | return $this->find(Project::class, $text, $limit); |
98 | 98 | } |
99 | 99 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @param int $limit 1-100 |
105 | 105 | * @return Tag[] |
106 | 106 | */ |
107 | - public function findTags (string $text, int $limit = 20) { |
|
107 | + public function findTags(string $text, int $limit = 20) { |
|
108 | 108 | return $this->find(Tag::class, $text, $limit); |
109 | 109 | } |
110 | 110 | |
@@ -115,14 +115,14 @@ discard block |
||
115 | 115 | * @param int $limit 1-100 |
116 | 116 | * @return Task[] |
117 | 117 | */ |
118 | - public function findTasks (string $text, int $limit = 20) { |
|
118 | + public function findTasks(string $text, int $limit = 20) { |
|
119 | 119 | return $this->find(Task::class, $text, $limit); |
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | 123 | * @return CustomField[] |
124 | 124 | */ |
125 | - public function getCustomFields () { |
|
125 | + public function getCustomFields() { |
|
126 | 126 | return $this->_loadAll(CustomField::class, "{$this}/custom_fields"); |
127 | 127 | } |
128 | 128 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return Portfolio[] |
135 | 135 | */ |
136 | - public function getPortfolios () { |
|
136 | + public function getPortfolios() { |
|
137 | 137 | return $this->_loadAll(Portfolio::class, "portfolios", [ |
138 | 138 | 'workspace' => $this->getGid(), |
139 | 139 | 'owner' => $this->api->getMe()->getGid() // the only allowed value, but still required. |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param array $filter |
147 | 147 | * @return Project[] |
148 | 148 | */ |
149 | - public function getProjects (array $filter = ['archived' => false]) { |
|
149 | + public function getProjects(array $filter = ['archived' => false]) { |
|
150 | 150 | $filter['workspace'] = $this->getGid(); |
151 | 151 | return $this->_loadAll(Project::class, 'projects', $filter); |
152 | 152 | } |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | /** |
155 | 155 | * @return Tag[] |
156 | 156 | */ |
157 | - public function getTags () { |
|
157 | + public function getTags() { |
|
158 | 158 | return $this->_loadAll(Tag::class, 'tags', ['workspace' => $this->getGid()]); |
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
162 | 162 | * @return Team[] |
163 | 163 | */ |
164 | - public function getTeams () { |
|
164 | + public function getTeams() { |
|
165 | 165 | return $this->_loadAll(Team::class, "organizations/{$this->getGid()}/teams"); |
166 | 166 | } |
167 | 167 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @param string $email |
170 | 170 | * @return null|User |
171 | 171 | */ |
172 | - public function getUserByEmail (string $email) { |
|
172 | + public function getUserByEmail(string $email) { |
|
173 | 173 | return $this->api->getCache()->get("users/{$email}", $this, function() use ($email) { |
174 | 174 | foreach ($this->getUsers() as $user) { |
175 | 175 | if ($user->getEmail() === $email) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | /** |
184 | 184 | * @return User[] |
185 | 185 | */ |
186 | - public function getUsers () { |
|
186 | + public function getUsers() { |
|
187 | 187 | return $this->_loadAll(User::class, "{$this}/users"); |
188 | 188 | } |
189 | 189 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * |
193 | 193 | * @return ProjectWebhook[]|TaskWebhook[] |
194 | 194 | */ |
195 | - public function getWebhooks () { |
|
195 | + public function getWebhooks() { |
|
196 | 196 | /** @var array $all */ |
197 | 197 | $all = $this->api->get('webhooks', ['workspace' => $this->getGid()], ['expand' => 'this']); |
198 | 198 | return array_map(function(array $each) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | /** |
210 | 210 | * @return bool |
211 | 211 | */ |
212 | - public function isOrganization (): bool { |
|
212 | + public function isOrganization(): bool { |
|
213 | 213 | return $this->_is('is_organization'); |
214 | 214 | } |
215 | 215 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * |
219 | 219 | * @return CustomField |
220 | 220 | */ |
221 | - public function newCustomField () { |
|
221 | + public function newCustomField() { |
|
222 | 222 | /** @var CustomField $field */ |
223 | 223 | $field = $this->_factory(CustomField::class); |
224 | 224 | return $field->setWorkspace($this); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @return Portfolio |
231 | 231 | */ |
232 | - public function newPortfolio () { |
|
232 | + public function newPortfolio() { |
|
233 | 233 | /** @var Portfolio $portfolio */ |
234 | 234 | $portfolio = $this->_factory(Portfolio::class); |
235 | 235 | return $portfolio->setWorkspace($this); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | * |
241 | 241 | * @return Project |
242 | 242 | */ |
243 | - public function newProject () { |
|
243 | + public function newProject() { |
|
244 | 244 | /** @var Project $project */ |
245 | 245 | $project = $this->_factory(Project::class); |
246 | 246 | return $project->setWorkspace($this); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * |
252 | 252 | * @return Tag |
253 | 253 | */ |
254 | - public function newTag () { |
|
254 | + public function newTag() { |
|
255 | 255 | /** @var Tag $tag */ |
256 | 256 | $tag = $this->_factory(Tag::class); |
257 | 257 | return $tag->setWorkspace($this); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * |
263 | 263 | * @return Task |
264 | 264 | */ |
265 | - public function newTask () { |
|
265 | + public function newTask() { |
|
266 | 266 | /** @var Task $task */ |
267 | 267 | $task = $this->_factory(Task::class); |
268 | 268 | return $task->setWorkspace($this); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * @param callable $filter `fn( CustomField $field ): bool` |
273 | 273 | * @return CustomField[] |
274 | 274 | */ |
275 | - public function selectCustomFields (callable $filter) { |
|
275 | + public function selectCustomFields(callable $filter) { |
|
276 | 276 | return $this->_select($this->getCustomFields(), $filter); |
277 | 277 | } |
278 | 278 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @param callable $filter `fn( Portfolio $portfolio ): bool` |
281 | 281 | * @return Portfolio[] |
282 | 282 | */ |
283 | - public function selectPortfolios (callable $filter) { |
|
283 | + public function selectPortfolios(callable $filter) { |
|
284 | 284 | return $this->_select($this->getPortfolios(), $filter); |
285 | 285 | } |
286 | 286 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | * @param callable $filter `fn( Project $project ): bool` |
289 | 289 | * @return Project[] |
290 | 290 | */ |
291 | - public function selectProjects (callable $filter) { |
|
291 | + public function selectProjects(callable $filter) { |
|
292 | 292 | return $this->_select($this->getProjects([]), $filter); |
293 | 293 | } |
294 | 294 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @param callable $filter `fn( Tag $tag ): bool` |
297 | 297 | * @return Tag[] |
298 | 298 | */ |
299 | - public function selectTags (callable $filter) { |
|
299 | + public function selectTags(callable $filter) { |
|
300 | 300 | return $this->_select($this->getTags(), $filter); |
301 | 301 | } |
302 | 302 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * @param callable $filter `fn( Team $team ): bool` |
305 | 305 | * @return Team[] |
306 | 306 | */ |
307 | - public function selectTeams (callable $filter) { |
|
307 | + public function selectTeams(callable $filter) { |
|
308 | 308 | return $this->_select($this->getTeams(), $filter); |
309 | 309 | } |
310 | 310 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | * @param callable $filter |
313 | 313 | * @return User[] |
314 | 314 | */ |
315 | - public function selectUsers (callable $filter) { |
|
315 | + public function selectUsers(callable $filter) { |
|
316 | 316 | return $this->_select($this->getUsers(), $filter); |
317 | 317 | } |
318 | 318 | } |
319 | 319 | \ No newline at end of file |
@@ -33,25 +33,25 @@ |
||
33 | 33 | 'workspace' => Workspace::class |
34 | 34 | ]; |
35 | 35 | |
36 | - final public function __toString (): string { |
|
36 | + final public function __toString(): string { |
|
37 | 37 | return "tags/{$this->getGid()}"; |
38 | 38 | } |
39 | 39 | |
40 | - final protected function _getDir (): string { |
|
40 | + final protected function _getDir(): string { |
|
41 | 41 | return 'tags'; |
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * @return Traversable|Task[] |
46 | 46 | */ |
47 | - public function getIterator () { |
|
47 | + public function getIterator() { |
|
48 | 48 | return $this->_loadEach(Task::class, "{$this}/tasks"); |
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @return Task[] |
53 | 53 | */ |
54 | - public function getTasks () { |
|
54 | + public function getTasks() { |
|
55 | 55 | return iterator_to_array($this); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | 'organization' => Workspace::class |
25 | 25 | ]; |
26 | 26 | |
27 | - final public function __toString (): string { |
|
27 | + final public function __toString(): string { |
|
28 | 28 | return "teams/{$this->getGid()}"; |
29 | 29 | } |
30 | 30 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param User $user |
33 | 33 | * @return $this |
34 | 34 | */ |
35 | - public function addUser (User $user) { |
|
35 | + public function addUser(User $user) { |
|
36 | 36 | $this->api->post("{$this}/addUser", ['user' => $user->getGid()]); |
37 | 37 | return $this; |
38 | 38 | } |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | * @param array $filter |
46 | 46 | * @return Project[] |
47 | 47 | */ |
48 | - public function getProjects (array $filter = ['archived' => false]) { |
|
48 | + public function getProjects(array $filter = ['archived' => false]) { |
|
49 | 49 | return $this->_loadAll(Project::class, "{$this}/projects", $filter); |
50 | 50 | } |
51 | 51 | |
52 | - public function getUrl (): string { |
|
52 | + public function getUrl(): string { |
|
53 | 53 | return "https://app.asana.com/0/{$this->getGid()}/overview"; |
54 | 54 | } |
55 | 55 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return User[] |
62 | 62 | */ |
63 | - public function getUsers () { |
|
63 | + public function getUsers() { |
|
64 | 64 | return $this->_loadAll(User::class, "{$this}/users"); |
65 | 65 | } |
66 | 66 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param User $user |
69 | 69 | * @return $this |
70 | 70 | */ |
71 | - public function removeUser (User $user) { |
|
71 | + public function removeUser(User $user) { |
|
72 | 72 | $this->api->post("{$this}/removeUser", ['user' => $user->getGid()]); |
73 | 73 | return $this; |
74 | 74 | } |