@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @return $this |
| 14 | 14 | */ |
| 15 | - public function update () { |
|
| 15 | + public function update() { |
|
| 16 | 16 | return $this->{'_save'}(); |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @param Api|Data $caller |
| 48 | 48 | * @param array $data |
| 49 | 49 | */ |
| 50 | - public function __construct ($caller, array $data = []) { |
|
| 50 | + public function __construct($caller, array $data = []) { |
|
| 51 | 51 | $this->api = $caller instanceof self ? $caller->api : $caller; |
| 52 | 52 | $this->_setData($data); |
| 53 | 53 | } |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | * @param array $args |
| 64 | 64 | * @return mixed |
| 65 | 65 | */ |
| 66 | - public function __call (string $method, array $args) { |
|
| 66 | + public function __call(string $method, array $args) { |
|
| 67 | 67 | static $cache = []; |
| 68 | - if (!$call =& $cache[$method]) { |
|
| 68 | + if (!$call = & $cache[$method]) { |
|
| 69 | 69 | preg_match('/^(get|has|is|set)(.+)$/', $method, $call); |
| 70 | 70 | $call[1] = '_' . $call[1]; |
| 71 | 71 | $call[2] = preg_replace_callback('/[A-Z]/', function(array $match) { |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | return $this->{$call[1]}($call[2], ...$args); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public function __debugInfo (): array { |
|
| 78 | + public function __debugInfo(): array { |
|
| 79 | 79 | return $this->data; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @param $field |
| 86 | 86 | * @return null|Data|mixed |
| 87 | 87 | */ |
| 88 | - final public function __get ($field) { |
|
| 88 | + final public function __get($field) { |
|
| 89 | 89 | return $this->_get($field); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @param $field |
| 98 | 98 | * @return bool |
| 99 | 99 | */ |
| 100 | - final public function __isset ($field) { |
|
| 100 | + final public function __isset($field) { |
|
| 101 | 101 | return true; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @param string $field |
| 110 | 110 | * @return mixed |
| 111 | 111 | */ |
| 112 | - protected function _get (string $field) { |
|
| 112 | + protected function _get(string $field) { |
|
| 113 | 113 | return $this->data[$field] ?? null; |
| 114 | 114 | } |
| 115 | 115 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * @param string $field |
| 124 | 124 | * @return bool |
| 125 | 125 | */ |
| 126 | - protected function _has (string $field): bool { |
|
| 126 | + protected function _has(string $field): bool { |
|
| 127 | 127 | $value = $this->_get($field); |
| 128 | 128 | if (isset($value)) { |
| 129 | 129 | if (is_countable($value)) { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * @param string $field |
| 147 | 147 | * @return bool |
| 148 | 148 | */ |
| 149 | - protected function _is (string $field): bool { |
|
| 149 | + protected function _is(string $field): bool { |
|
| 150 | 150 | return !empty($this->_get($field)); |
| 151 | 151 | } |
| 152 | 152 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * @param mixed $value |
| 160 | 160 | * @return $this |
| 161 | 161 | */ |
| 162 | - protected function _set (string $field, $value) { |
|
| 162 | + protected function _set(string $field, $value) { |
|
| 163 | 163 | $this->data[$field] = $value; |
| 164 | 164 | $this->diff[$field] = true; |
| 165 | 165 | return $this; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * |
| 171 | 171 | * @param array $data |
| 172 | 172 | */ |
| 173 | - protected function _setData (array $data): void { |
|
| 173 | + protected function _setData(array $data): void { |
|
| 174 | 174 | $this->data = $this->diff = []; |
| 175 | 175 | foreach ($data as $field => $value) { |
| 176 | 176 | $this->_setMapped($field, $value); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * @param string $field |
| 184 | 184 | * @param mixed $value |
| 185 | 185 | */ |
| 186 | - protected function _setMapped (string $field, $value): void { |
|
| 186 | + protected function _setMapped(string $field, $value): void { |
|
| 187 | 187 | unset($this->diff[$field]); |
| 188 | 188 | |
| 189 | 189 | // use value as-is? |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | * @param array $data |
| 232 | 232 | * @return mixed|Data|AbstractEntity |
| 233 | 233 | */ |
| 234 | - final protected function factory (string $class, array $data = []) { |
|
| 234 | + final protected function factory(string $class, array $data = []) { |
|
| 235 | 235 | return $this->api->factory($class, $this, $data); |
| 236 | 236 | } |
| 237 | 237 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | * |
| 241 | 241 | * @return array |
| 242 | 242 | */ |
| 243 | - public function getDiff (): array { |
|
| 243 | + public function getDiff(): array { |
|
| 244 | 244 | $convert = function($each) use (&$convert) { |
| 245 | 245 | // convert existing entities to gids |
| 246 | 246 | if ($each instanceof AbstractEntity and $each->hasGid()) { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * |
| 266 | 266 | * @return bool |
| 267 | 267 | */ |
| 268 | - final public function isDiff (): bool { |
|
| 268 | + final public function isDiff(): bool { |
|
| 269 | 269 | return (bool)$this->diff; |
| 270 | 270 | } |
| 271 | 271 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | * @see toArray() |
| 274 | 274 | * @return array |
| 275 | 275 | */ |
| 276 | - public function jsonSerialize (): array { |
|
| 276 | + public function jsonSerialize(): array { |
|
| 277 | 277 | return $this->toArray(); |
| 278 | 278 | } |
| 279 | 279 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | * @param array $query |
| 288 | 288 | * @return null|mixed|AbstractEntity |
| 289 | 289 | */ |
| 290 | - final protected function load (string $class, string $path, array $query = []) { |
|
| 290 | + final protected function load(string $class, string $path, array $query = []) { |
|
| 291 | 291 | return $this->api->load($class, $this, $path, $query); |
| 292 | 292 | } |
| 293 | 293 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | * @param int $pages |
| 303 | 303 | * @return array|AbstractEntity[] |
| 304 | 304 | */ |
| 305 | - final protected function loadAll (string $class, string $path, array $query = [], int $pages = 0) { |
|
| 305 | + final protected function loadAll(string $class, string $path, array $query = [], int $pages = 0) { |
|
| 306 | 306 | return $this->api->loadAll($class, $this, $path, $query, $pages); |
| 307 | 307 | } |
| 308 | 308 | |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | * |
| 312 | 312 | * @return string |
| 313 | 313 | */ |
| 314 | - public function serialize (): string { |
|
| 314 | + public function serialize(): string { |
|
| 315 | 315 | return json_encode($this); |
| 316 | 316 | } |
| 317 | 317 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * |
| 321 | 321 | * @return array |
| 322 | 322 | */ |
| 323 | - public function toArray (): array { |
|
| 323 | + public function toArray(): array { |
|
| 324 | 324 | return array_map($dehydrate = function($each) use (&$dehydrate) { |
| 325 | 325 | if ($each instanceof AbstractEntity and $each->hasGid()) { |
| 326 | 326 | return $each->getGid(); |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | * |
| 341 | 341 | * @param $serialized |
| 342 | 342 | */ |
| 343 | - public function unserialize ($serialized): void { |
|
| 343 | + public function unserialize($serialized): void { |
|
| 344 | 344 | $this->api = Api::getDefault(); |
| 345 | 345 | $data = json_decode($serialized, true); |
| 346 | 346 | $this->_setData($data); |
@@ -218,8 +218,7 @@ discard block |
||
| 218 | 218 | if (is_array($class)) { |
| 219 | 219 | $class = $class[0]; |
| 220 | 220 | $this->data[$field] = array_map($hydrate, $value); |
| 221 | - } |
|
| 222 | - else { |
|
| 221 | + } else { |
|
| 223 | 222 | $this->data[$field] = $hydrate($value); |
| 224 | 223 | } |
| 225 | 224 | } |
@@ -324,11 +323,9 @@ discard block |
||
| 324 | 323 | return array_map($dehydrate = function($each) use (&$dehydrate) { |
| 325 | 324 | if ($each instanceof AbstractEntity and $each->hasGid()) { |
| 326 | 325 | return $each->getGid(); |
| 327 | - } |
|
| 328 | - elseif ($each instanceof self) { |
|
| 326 | + } elseif ($each instanceof self) { |
|
| 329 | 327 | return $each->toArray(); |
| 330 | - } |
|
| 331 | - elseif (is_array($each)) { |
|
| 328 | + } elseif (is_array($each)) { |
|
| 332 | 329 | return array_map($dehydrate, $each); |
| 333 | 330 | } |
| 334 | 331 | return $each; |
@@ -33,23 +33,23 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | protected $customField; |
| 35 | 35 | |
| 36 | - public function __construct (CustomField $customField, array $data = []) { |
|
| 36 | + public function __construct(CustomField $customField, array $data = []) { |
|
| 37 | 37 | parent::__construct($customField, $data); |
| 38 | 38 | $this->customField = $customField; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - final public function __toString (): string { |
|
| 41 | + final public function __toString(): string { |
|
| 42 | 42 | return "enum_options/{$this->getGid()}"; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - final protected function _getDir (): string { |
|
| 45 | + final protected function _getDir(): string { |
|
| 46 | 46 | return "{$this->customField}/enum_options"; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * @return CustomField |
| 51 | 51 | */ |
| 52 | - public function getCustomField () { |
|
| 52 | + public function getCustomField() { |
|
| 53 | 53 | return $this->customField; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @param EnumOption $option |
| 59 | 59 | * @return $this |
| 60 | 60 | */ |
| 61 | - public function moveAfter (EnumOption $option) { |
|
| 61 | + public function moveAfter(EnumOption $option) { |
|
| 62 | 62 | $this->api->post("{$this->_getDir()}/insert", [ |
| 63 | 63 | 'after_enum_option' => $option->getGid(), |
| 64 | 64 | 'enum_option' => $this->getGid() |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param EnumOption $option |
| 73 | 73 | * @return $this |
| 74 | 74 | */ |
| 75 | - public function moveBefore (EnumOption $option) { |
|
| 75 | + public function moveBefore(EnumOption $option) { |
|
| 76 | 76 | $this->api->post("{$this->_getDir()}/insert", [ |
| 77 | 77 | 'before_enum_option' => $option->getGid(), |
| 78 | 78 | 'enum_option' => $this->getGid() |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * @return $this |
| 86 | 86 | */ |
| 87 | - public function moveFirst () { |
|
| 87 | + public function moveFirst() { |
|
| 88 | 88 | $first = $this->customField->getEnumOptions()[0]; |
| 89 | 89 | if ($first !== $this) { |
| 90 | 90 | $this->moveBefore($first); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | /** |
| 96 | 96 | * @return $this |
| 97 | 97 | */ |
| 98 | - public function moveLast () { |
|
| 98 | + public function moveLast() { |
|
| 99 | 99 | $options = $this->customField->getEnumOptions(); |
| 100 | 100 | $last = $options[count($options) - 1]; |
| 101 | 101 | if ($last !== $this) { |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | 'memberships' => 'memberships.(project|section)' |
| 92 | 92 | ]; |
| 93 | 93 | |
| 94 | - final public function __toString (): string { |
|
| 94 | + final public function __toString(): string { |
|
| 95 | 95 | return "tasks/{$this->getGid()}"; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - final protected function _getDir (): string { |
|
| 98 | + final protected function _getDir(): string { |
|
| 99 | 99 | return 'tasks'; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - protected function _save (string $dir = null) { |
|
| 102 | + protected function _save(string $dir = null) { |
|
| 103 | 103 | parent::_save($dir); |
| 104 | 104 | // use isset() to avoid has() fetch. |
| 105 | 105 | if (isset($this->data['custom_fields'])) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | return $this; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - protected function _setData (array $data): void { |
|
| 114 | + protected function _setData(array $data): void { |
|
| 115 | 115 | unset($data['hearted']); // deprecated for likes |
| 116 | 116 | unset($data['hearts']); // deprecated for likes |
| 117 | 117 | unset($data['projects']); // redundant, memberships are used instead |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @param string $file |
| 126 | 126 | * @return Attachment |
| 127 | 127 | */ |
| 128 | - public function addAttachment (string $file) { |
|
| 128 | + public function addAttachment(string $file) { |
|
| 129 | 129 | /** @var Attachment $attachment */ |
| 130 | 130 | $attachment = $this->factory(Attachment::class, ['parent' => $this]); |
| 131 | 131 | return $attachment->upload($file); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @param string $text |
| 138 | 138 | * @return Story |
| 139 | 139 | */ |
| 140 | - public function addComment (string $text) { |
|
| 140 | + public function addComment(string $text) { |
|
| 141 | 141 | return $this->newComment()->setText($text)->create(); |
| 142 | 142 | } |
| 143 | 143 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @param Task[] $tasks |
| 149 | 149 | * @return $this |
| 150 | 150 | */ |
| 151 | - public function addDependencies (array $tasks) { |
|
| 151 | + public function addDependencies(array $tasks) { |
|
| 152 | 152 | $this->api->post("{$this}/addDependencies", ['dependents' => array_column($tasks, 'gid')]); |
| 153 | 153 | return $this; |
| 154 | 154 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param Task $task |
| 161 | 161 | * @return $this |
| 162 | 162 | */ |
| 163 | - public function addDependency (Task $task) { |
|
| 163 | + public function addDependency(Task $task) { |
|
| 164 | 164 | return $this->addDependencies([$task]); |
| 165 | 165 | } |
| 166 | 166 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @param Task $task |
| 172 | 172 | * @return $this |
| 173 | 173 | */ |
| 174 | - public function addDependent (Task $task) { |
|
| 174 | + public function addDependent(Task $task) { |
|
| 175 | 175 | return $this->addDependents([$task]); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @param Task[] $tasks |
| 183 | 183 | * @return $this |
| 184 | 184 | */ |
| 185 | - public function addDependents (array $tasks) { |
|
| 185 | + public function addDependents(array $tasks) { |
|
| 186 | 186 | $this->api->post("{$this}/addDependents", ['dependents' => array_column($tasks, 'gid')]); |
| 187 | 187 | return $this; |
| 188 | 188 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * @param User $user |
| 194 | 194 | * @return $this |
| 195 | 195 | */ |
| 196 | - public function addFollower (User $user) { |
|
| 196 | + public function addFollower(User $user) { |
|
| 197 | 197 | return $this->addFollowers([$user]); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | * @param User[] $users |
| 206 | 206 | * @return $this |
| 207 | 207 | */ |
| 208 | - public function addFollowers (array $users) { |
|
| 208 | + public function addFollowers(array $users) { |
|
| 209 | 209 | return $this->_addWithPost("{$this}/addFollowers", [ |
| 210 | 210 | 'followers' => array_column($users, 'gid') |
| 211 | 211 | ], 'followers', $users); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * @param Tag $tag |
| 220 | 220 | * @return $this |
| 221 | 221 | */ |
| 222 | - public function addTag (Tag $tag) { |
|
| 222 | + public function addTag(Tag $tag) { |
|
| 223 | 223 | return $this->_addWithPost("{$this}/addTag", [ |
| 224 | 224 | 'tag' => $tag->getGid() |
| 225 | 225 | ], 'tags', [$tag]); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @param Section|null $section |
| 235 | 235 | * @return $this |
| 236 | 236 | */ |
| 237 | - public function addToProject (Project $project, Section $section = null) { |
|
| 237 | + public function addToProject(Project $project, Section $section = null) { |
|
| 238 | 238 | /** @var Membership $membership */ |
| 239 | 239 | $membership = $this->factory(Membership::class) |
| 240 | 240 | ->_set('project', $project) |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * @param string $target |
| 250 | 250 | * @return TaskWebhook |
| 251 | 251 | */ |
| 252 | - public function addWebhook (string $target) { |
|
| 252 | + public function addWebhook(string $target) { |
|
| 253 | 253 | /** @var TaskWebhook $webhook */ |
| 254 | 254 | $webhook = $this->factory(TaskWebhook::class); |
| 255 | 255 | return $webhook->create($this, $target); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * @param string[] $include |
| 266 | 266 | * @return Job |
| 267 | 267 | */ |
| 268 | - public function duplicate (string $name, array $include) { |
|
| 268 | + public function duplicate(string $name, array $include) { |
|
| 269 | 269 | /** @var array $remote */ |
| 270 | 270 | $remote = $this->api->post("{$this}/duplicate", [ |
| 271 | 271 | 'name' => $name, |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | * @depends after-create |
| 281 | 281 | * @return Attachment[] |
| 282 | 282 | */ |
| 283 | - public function getAttachments () { |
|
| 283 | + public function getAttachments() { |
|
| 284 | 284 | return $this->loadAll(Attachment::class, "{$this}/attachments"); |
| 285 | 285 | } |
| 286 | 286 | |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * @depends after-create |
| 291 | 291 | * @return Story[] |
| 292 | 292 | */ |
| 293 | - public function getComments () { |
|
| 293 | + public function getComments() { |
|
| 294 | 294 | return array_values(array_filter($this->getStories(), function(Story $story) { |
| 295 | 295 | return $story->isComment(); |
| 296 | 296 | })); |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | * @depends after-create |
| 303 | 303 | * @return Task[] |
| 304 | 304 | */ |
| 305 | - public function getDependencies () { |
|
| 305 | + public function getDependencies() { |
|
| 306 | 306 | return $this->loadAll(self::class, "{$this}/dependencies"); |
| 307 | 307 | } |
| 308 | 308 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | * @depends after-create |
| 313 | 313 | * @return Task[] |
| 314 | 314 | */ |
| 315 | - public function getDependents () { |
|
| 315 | + public function getDependents() { |
|
| 316 | 316 | return $this->loadAll(self::class, "{$this}/dependents"); |
| 317 | 317 | } |
| 318 | 318 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | * @param null|string $token |
| 324 | 324 | * @return TaskEvent[]|StoryEvent[] |
| 325 | 325 | */ |
| 326 | - public function getEvents (&$token) { |
|
| 326 | + public function getEvents(&$token) { |
|
| 327 | 327 | return $this->api->sync($this, $token); |
| 328 | 328 | } |
| 329 | 329 | |
@@ -335,14 +335,14 @@ discard block |
||
| 335 | 335 | * |
| 336 | 336 | * @return External |
| 337 | 337 | */ |
| 338 | - public function getExternal () { |
|
| 338 | + public function getExternal() { |
|
| 339 | 339 | return $this->_get('external') ?? $this->data['external'] = $this->factory(External::class); |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | /** |
| 343 | 343 | * @return Project[] |
| 344 | 344 | */ |
| 345 | - public function getProjects () { |
|
| 345 | + public function getProjects() { |
|
| 346 | 346 | return array_map(function(Membership $membership) { |
| 347 | 347 | return $membership->getProject(); |
| 348 | 348 | }, $this->getMemberships()); |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | * @depends after-create |
| 355 | 355 | * @return Story[] |
| 356 | 356 | */ |
| 357 | - public function getStories () { |
|
| 357 | + public function getStories() { |
|
| 358 | 358 | return $this->loadAll(Story::class, "{$this}/stories"); |
| 359 | 359 | } |
| 360 | 360 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | * @depends after-create |
| 365 | 365 | * @return Task[] |
| 366 | 366 | */ |
| 367 | - public function getSubTasks () { |
|
| 367 | + public function getSubTasks() { |
|
| 368 | 368 | return $this->loadAll(self::class, "{$this}/subtasks"); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | * @depends after-create |
| 375 | 375 | * @return string |
| 376 | 376 | */ |
| 377 | - public function getUrl (): string { |
|
| 377 | + public function getUrl(): string { |
|
| 378 | 378 | return "https://app.asana.com/0/0/{$this->getGid()}"; |
| 379 | 379 | } |
| 380 | 380 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | * @depends after-create |
| 385 | 385 | * @return TaskWebhook[] |
| 386 | 386 | */ |
| 387 | - public function getWebhooks () { |
|
| 387 | + public function getWebhooks() { |
|
| 388 | 388 | return $this->loadAll(TaskWebhook::class, 'webhooks', [ |
| 389 | 389 | 'workspace' => $this->getWorkspace()->getGid(), |
| 390 | 390 | 'resource' => $this->getGid() |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | /** |
| 395 | 395 | * @return bool |
| 396 | 396 | */ |
| 397 | - public function isRenderedAsSeparator (): bool { |
|
| 397 | + public function isRenderedAsSeparator(): bool { |
|
| 398 | 398 | return $this->_is('is_rendered_as_separator'); |
| 399 | 399 | } |
| 400 | 400 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | * @depends after-create |
| 405 | 405 | * @return Story |
| 406 | 406 | */ |
| 407 | - public function newComment () { |
|
| 407 | + public function newComment() { |
|
| 408 | 408 | /** @var Story $comment */ |
| 409 | 409 | $comment = $this->factory(Story::class, [ |
| 410 | 410 | 'resource_subtype' => Story::TYPE_COMMENT_ADDED |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | * @depends after-create |
| 419 | 419 | * @return Task |
| 420 | 420 | */ |
| 421 | - public function newSubTask () { |
|
| 421 | + public function newSubTask() { |
|
| 422 | 422 | /** @var Task $sub */ |
| 423 | 423 | $sub = $this->factory(self::class); |
| 424 | 424 | return $sub->setParent($this); |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | * @param Task[] $tasks |
| 432 | 432 | * @return $this |
| 433 | 433 | */ |
| 434 | - public function removeDependencies (array $tasks) { |
|
| 434 | + public function removeDependencies(array $tasks) { |
|
| 435 | 435 | $this->api->post("{$this}/removeDependencies", ['dependencies' => array_column($tasks, 'gid')]); |
| 436 | 436 | return $this; |
| 437 | 437 | } |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | * @param Task $task |
| 444 | 444 | * @return $this |
| 445 | 445 | */ |
| 446 | - public function removeDependency (Task $task) { |
|
| 446 | + public function removeDependency(Task $task) { |
|
| 447 | 447 | return $this->removeDependencies([$task]); |
| 448 | 448 | } |
| 449 | 449 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | * @param Task $task |
| 455 | 455 | * @return $this |
| 456 | 456 | */ |
| 457 | - public function removeDependent (Task $task) { |
|
| 457 | + public function removeDependent(Task $task) { |
|
| 458 | 458 | return $this->removeDependents([$task]); |
| 459 | 459 | } |
| 460 | 460 | |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | * @param Task[] $tasks |
| 466 | 466 | * @return $this |
| 467 | 467 | */ |
| 468 | - public function removeDependents (array $tasks) { |
|
| 468 | + public function removeDependents(array $tasks) { |
|
| 469 | 469 | $this->api->post("{$this}/removeDependents", ['dependents' => array_column($tasks, 'gid')]); |
| 470 | 470 | return $this; |
| 471 | 471 | } |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | * @param User $user |
| 477 | 477 | * @return $this |
| 478 | 478 | */ |
| 479 | - public function removeFollower (User $user) { |
|
| 479 | + public function removeFollower(User $user) { |
|
| 480 | 480 | return $this->removeFollowers([$user]); |
| 481 | 481 | } |
| 482 | 482 | |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | * @param User[] $users |
| 489 | 489 | * @return $this |
| 490 | 490 | */ |
| 491 | - public function removeFollowers (array $users) { |
|
| 491 | + public function removeFollowers(array $users) { |
|
| 492 | 492 | return $this->_removeWithPost("{$this}/removeFollowers", [ |
| 493 | 493 | 'followers' => array_column($users, 'gid') |
| 494 | 494 | ], 'followers', $users); |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | * @param Project $project |
| 503 | 503 | * @return $this |
| 504 | 504 | */ |
| 505 | - public function removeFromProject (Project $project) { |
|
| 505 | + public function removeFromProject(Project $project) { |
|
| 506 | 506 | return $this->_removeWithPost("{$this}/removeProject", [ |
| 507 | 507 | 'project' => $project->getGid() |
| 508 | 508 | ], 'memberships', function(Membership $membership) use ($project) { |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | * @param Tag $tag |
| 519 | 519 | * @return $this |
| 520 | 520 | */ |
| 521 | - public function removeTag (Tag $tag) { |
|
| 521 | + public function removeTag(Tag $tag) { |
|
| 522 | 522 | return $this->_removeWithPost("{$this}/removeTag", [ |
| 523 | 523 | 'tag' => $tag->getGid() |
| 524 | 524 | ], 'tags', [$tag]); |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | * @param null|Task $parent |
| 532 | 532 | * @return $this |
| 533 | 533 | */ |
| 534 | - public function setParent (?self $parent) { |
|
| 534 | + public function setParent(?self $parent) { |
|
| 535 | 535 | return $this->_setWithPost("{$this}/setParent", [ |
| 536 | 536 | 'parent' => $parent |
| 537 | 537 | ], 'parent', $parent); |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | * @param bool $flag |
| 542 | 542 | * @return $this |
| 543 | 543 | */ |
| 544 | - public function setRenderedAsSeparator (bool $flag) { |
|
| 544 | + public function setRenderedAsSeparator(bool $flag) { |
|
| 545 | 545 | return $this->_set('is_rendered_as_separator', $flag); |
| 546 | 546 | } |
| 547 | 547 | |