@@ -39,15 +39,15 @@ discard block |
||
| 39 | 39 | const TYPE_LIKED = 'liked'; |
| 40 | 40 | const TYPE_TAGGED = 'added_to_tag'; |
| 41 | 41 | |
| 42 | - final public function __toString (): string { |
|
| 42 | + final public function __toString(): string { |
|
| 43 | 43 | return "stories/{$this->getGid()}"; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - final protected function _getDir (): string { |
|
| 46 | + final protected function _getDir(): string { |
|
| 47 | 47 | return "{$this->getTask()}/stories"; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - protected function _getMap (): array { |
|
| 50 | + protected function _getMap(): array { |
|
| 51 | 51 | return [ |
| 52 | 52 | 'created_by' => User::class, |
| 53 | 53 | 'likes' => [User::class], |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | ]; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - final public function isComment (): bool { |
|
| 58 | + final public function isComment(): bool { |
|
| 59 | 59 | return $this->getResourceSubtype() === self::TYPE_COMMENT_ADDED; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function isEdited (): bool { |
|
| 62 | + public function isEdited(): bool { |
|
| 63 | 63 | return $this->_is('is_edited'); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - public function isPinned (): bool { |
|
| 66 | + public function isPinned(): bool { |
|
| 67 | 67 | return $this->_is('is_pinned'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @param bool $pinned |
| 72 | 72 | * @return $this |
| 73 | 73 | */ |
| 74 | - public function setPinned (bool $pinned) { |
|
| 74 | + public function setPinned(bool $pinned) { |
|
| 75 | 75 | return $this->_set('is_pinned', $pinned); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | const TYPE = 'tag'; |
| 28 | 28 | |
| 29 | - final public function __toString (): string { |
|
| 29 | + final public function __toString(): string { |
|
| 30 | 30 | return "tags/{$this->getGid()}"; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - final protected function _getDir (): string { |
|
| 33 | + final protected function _getDir(): string { |
|
| 34 | 34 | return 'tags'; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - protected function _getMap (): array { |
|
| 37 | + protected function _getMap(): array { |
|
| 38 | 38 | return [ |
| 39 | 39 | 'followers' => [User::class], |
| 40 | 40 | 'workspace' => Workspace::class |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | /** |
| 45 | 45 | * @return Task[] |
| 46 | 46 | */ |
| 47 | - public function getTasks () { |
|
| 47 | + public function getTasks() { |
|
| 48 | 48 | return $this->loadAll(Task::class, "{$this}/tasks"); |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | \ No newline at end of file |
@@ -23,15 +23,15 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | const TYPE = 'section'; |
| 25 | 25 | |
| 26 | - final public function __toString (): string { |
|
| 26 | + final public function __toString(): string { |
|
| 27 | 27 | return "sections/{$this->getGid()}"; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - final protected function _getDir (): string { |
|
| 30 | + final protected function _getDir(): string { |
|
| 31 | 31 | return "{$this->getProject()}/sections"; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - protected function _getMap (): array { |
|
| 34 | + protected function _getMap(): array { |
|
| 35 | 35 | return [ |
| 36 | 36 | 'projects' => [Project::class] |
| 37 | 37 | ]; |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * @return Project |
| 42 | 42 | */ |
| 43 | - public function getProject () { |
|
| 43 | + public function getProject() { |
|
| 44 | 44 | return $this->_get('projects')[0]; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * @return Task[] |
| 49 | 49 | */ |
| 50 | - public function getTasks () { |
|
| 50 | + public function getTasks() { |
|
| 51 | 51 | return $this->loadAll(Task::class, 'tasks', ['section' => $this->getGid()]); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @after-create |
| 58 | 58 | * @return Task |
| 59 | 59 | */ |
| 60 | - public function newTask () { |
|
| 60 | + public function newTask() { |
|
| 61 | 61 | /** @var Task $task */ |
| 62 | 62 | $task = $this->factory(Task::class); |
| 63 | 63 | return $task->addToProject($this); |
@@ -48,20 +48,20 @@ discard block |
||
| 48 | 48 | * @param Project $project |
| 49 | 49 | * @param array $data |
| 50 | 50 | */ |
| 51 | - public function __construct (Project $project, array $data = []) { |
|
| 51 | + public function __construct(Project $project, array $data = []) { |
|
| 52 | 52 | parent::__construct($project, $data); |
| 53 | 53 | $this->project = $project; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - final public function __toString (): string { |
|
| 56 | + final public function __toString(): string { |
|
| 57 | 57 | return "project_statuses/{$this->getGid()}"; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - final protected function _getDir (): string { |
|
| 60 | + final protected function _getDir(): string { |
|
| 61 | 61 | return "{$this->project}/project_statuses"; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - protected function _getMap (): array { |
|
| 64 | + protected function _getMap(): array { |
|
| 65 | 65 | return [ |
| 66 | 66 | 'created_by' => User::class |
| 67 | 67 | ]; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | /** |
| 71 | 71 | * @return Project |
| 72 | 72 | */ |
| 73 | - public function getProject () { |
|
| 73 | + public function getProject() { |
|
| 74 | 74 | return $this->project; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | \ No newline at end of file |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | const STATUS_SUCCESS = 'succeeded'; // api docs say "completed" but that's wrong. |
| 29 | 29 | const STATUS_FAIL = 'failed'; |
| 30 | 30 | |
| 31 | - final public function __toString (): string { |
|
| 31 | + final public function __toString(): string { |
|
| 32 | 32 | return "jobs/{$this->getGid()}"; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - protected function _getMap (): array { |
|
| 35 | + protected function _getMap(): array { |
|
| 36 | 36 | return [ |
| 37 | 37 | 'new_project' => Project::class, |
| 38 | 38 | 'new_task' => Task::class |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return bool |
| 46 | 46 | */ |
| 47 | - public function isActive (): bool { |
|
| 47 | + public function isActive(): bool { |
|
| 48 | 48 | return $this->getStatus() === self::STATUS_ACTIVE; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return bool |
| 55 | 55 | */ |
| 56 | - public function isDone (): bool { |
|
| 56 | + public function isDone(): bool { |
|
| 57 | 57 | return $this->isSuccessful() or $this->isFailed(); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @return bool |
| 64 | 64 | */ |
| 65 | - public function isFailed (): bool { |
|
| 65 | + public function isFailed(): bool { |
|
| 66 | 66 | return $this->getStatus() === self::STATUS_FAIL; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * |
| 72 | 72 | * @return bool |
| 73 | 73 | */ |
| 74 | - public function isQueued (): bool { |
|
| 74 | + public function isQueued(): bool { |
|
| 75 | 75 | return $this->getStatus() === self::STATUS_QUEUED; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @return bool |
| 82 | 82 | */ |
| 83 | - public function isSuccessful (): bool { |
|
| 83 | + public function isSuccessful(): bool { |
|
| 84 | 84 | return $this->getStatus() === self::STATUS_SUCCESS; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * |
| 90 | 90 | * @return $this |
| 91 | 91 | */ |
| 92 | - public function wait () { |
|
| 92 | + public function wait() { |
|
| 93 | 93 | while (!$this->isDone()) { |
| 94 | 94 | sleep(3); |
| 95 | 95 | $this->reload(); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | trait DeleteTrait { |
| 12 | 12 | |
| 13 | - public function delete (): void { |
|
| 13 | + public function delete(): void { |
|
| 14 | 14 | /** @var Api $api */ |
| 15 | 15 | $api = $this->api; |
| 16 | 16 | $api->delete($this); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * @param Workspace $workspace |
| 18 | 18 | * @return $this |
| 19 | 19 | */ |
| 20 | - public function setWorkspace (Workspace $workspace) { |
|
| 20 | + public function setWorkspace(Workspace $workspace) { |
|
| 21 | 21 | assert(!$this->hasGid()); |
| 22 | 22 | return $this->_set('workspace', $workspace); |
| 23 | 23 | } |
@@ -15,12 +15,12 @@ |
||
| 15 | 15 | * |
| 16 | 16 | * @return string |
| 17 | 17 | */ |
| 18 | - abstract protected function _getDir (): string; |
|
| 18 | + abstract protected function _getDir(): string; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @return $this |
| 22 | 22 | */ |
| 23 | - public function create () { |
|
| 23 | + public function create() { |
|
| 24 | 24 | /** @var Api $api */ |
| 25 | 25 | $api = $this->api; |
| 26 | 26 | $remote = $api->post($this->_getDir(), $this->_getPatch(), ['expand' => 'this']); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | /** |
| 14 | 14 | * @return $this |
| 15 | 15 | */ |
| 16 | - public function update () { |
|
| 16 | + public function update() { |
|
| 17 | 17 | if ($this->isDiff()) { |
| 18 | 18 | /** @var Api $api */ |
| 19 | 19 | $api = $this->api; |