@@ -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 | return $this->{'_set'}('workspace', $workspace); |
22 | 22 | } |
23 | 23 | } |
24 | 24 | \ No newline at end of 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 | } |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return null|bool|number|string|array |
48 | 48 | */ |
49 | - public function getDataJsonDecoded () { |
|
49 | + public function getDataJsonDecoded() { |
|
50 | 50 | if (strlen($data = $this->getData())) { |
51 | - return json_decode($data, true, 512, JSON_BIGINT_AS_STRING | JSON_THROW_ON_ERROR); |
|
51 | + return json_decode($data, true, 512, JSON_BIGINT_AS_STRING|JSON_THROW_ON_ERROR); |
|
52 | 52 | } |
53 | 53 | return null; |
54 | 54 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param mixed $data |
61 | 61 | * @return $this |
62 | 62 | */ |
63 | - public function setDataJsonEncoded ($data) { |
|
63 | + public function setDataJsonEncoded($data) { |
|
64 | 64 | if (isset($data)) { |
65 | 65 | return $this->setData(json_encode($data, JSON_THROW_ON_ERROR)); |
66 | 66 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * @param PSR16 $psr |
36 | 36 | */ |
37 | - public function __construct (PSR16 $psr) { |
|
37 | + public function __construct(PSR16 $psr) { |
|
38 | 38 | $this->psr = $psr; |
39 | 39 | $this->ttl = new DateInterval('PT1H'); |
40 | 40 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @param string $key |
44 | 44 | * @throws InvalidArgumentException |
45 | 45 | */ |
46 | - protected function _delete (string $key) { |
|
46 | + protected function _delete(string $key) { |
|
47 | 47 | $this->psr->delete('asana/' . $key); |
48 | 48 | } |
49 | 49 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @return null|string|AbstractEntity |
53 | 53 | * @throws InvalidArgumentException |
54 | 54 | */ |
55 | - protected function _get (string $key) { |
|
55 | + protected function _get(string $key) { |
|
56 | 56 | return $this->psr->get('asana/' . $key); |
57 | 57 | } |
58 | 58 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param mixed $value |
62 | 62 | * @throws InvalidArgumentException |
63 | 63 | */ |
64 | - protected function _set (string $key, $value) { |
|
64 | + protected function _set(string $key, $value) { |
|
65 | 65 | $this->psr->set('asana/' . $key, $value, $this->ttl); |
66 | 66 | } |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @return bool |
71 | 71 | * @throws InvalidArgumentException |
72 | 72 | */ |
73 | - public function add (AbstractEntity $entity): bool { |
|
73 | + public function add(AbstractEntity $entity): bool { |
|
74 | 74 | if (parent::add($entity)) { |
75 | 75 | $this->_set($entity->getGid(), $entity); |
76 | 76 | return true; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @param string[] $keys |
84 | 84 | * @throws InvalidArgumentException |
85 | 85 | */ |
86 | - protected function addKeys (string $gid, array $keys): void { |
|
86 | + protected function addKeys(string $gid, array $keys): void { |
|
87 | 87 | parent::addKeys($gid, $keys); |
88 | 88 | // stash gid refs |
89 | 89 | foreach ($keys as $key) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @return null|AbstractEntity |
101 | 101 | * @throws InvalidArgumentException |
102 | 102 | */ |
103 | - public function get (string $key, $caller, Closure $factory) { |
|
103 | + public function get(string $key, $caller, Closure $factory) { |
|
104 | 104 | // POOL MISS && CACHE HIT |
105 | 105 | if (!isset($this->gids[$key]) and $entity = $this->_get($key)) { |
106 | 106 | if ($entity instanceof AbstractEntity) { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | /** |
124 | 124 | * @return DateInterval |
125 | 125 | */ |
126 | - public function getTtl () { |
|
126 | + public function getTtl() { |
|
127 | 127 | return $this->ttl; |
128 | 128 | } |
129 | 129 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | * @param AbstractEntity $entity |
132 | 132 | * @throws InvalidArgumentException |
133 | 133 | */ |
134 | - public function remove (AbstractEntity $entity): void { |
|
134 | + public function remove(AbstractEntity $entity): void { |
|
135 | 135 | parent::remove($entity); |
136 | 136 | foreach ($entity->getCacheKeys() as $key) { |
137 | 137 | $this->_delete($key); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @param DateInterval $ttl |
143 | 143 | * @return $this |
144 | 144 | */ |
145 | - public function setTtl (DateInterval $ttl) { |
|
145 | + public function setTtl(DateInterval $ttl) { |
|
146 | 146 | $this->ttl = $ttl; |
147 | 147 | return $this; |
148 | 148 | } |
@@ -18,13 +18,13 @@ |
||
18 | 18 | 'user' => User::class |
19 | 19 | ]; |
20 | 20 | |
21 | - protected function _setData (array $data): void { |
|
21 | + protected function _setData(array $data): void { |
|
22 | 22 | // useless. likes aren't entities. |
23 | 23 | unset($data['gid'], $data['resource_type']); |
24 | 24 | parent::_setData($data); |
25 | 25 | } |
26 | 26 | |
27 | - final public function getResourceType (): string { |
|
27 | + final public function getResourceType(): string { |
|
28 | 28 | return self::TYPE; |
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -44,45 +44,45 @@ discard block |
||
44 | 44 | 'target' => Task::class |
45 | 45 | ]; |
46 | 46 | |
47 | - final public function __toString (): string { |
|
47 | + final public function __toString(): string { |
|
48 | 48 | return "stories/{$this->getGid()}"; |
49 | 49 | } |
50 | 50 | |
51 | - final protected function _getDir (): string { |
|
51 | + final protected function _getDir(): string { |
|
52 | 52 | return "{$this->getTarget()}/stories"; |
53 | 53 | } |
54 | 54 | |
55 | - protected function _setData (array $data): void { |
|
55 | + protected function _setData(array $data): void { |
|
56 | 56 | // hearts are deprecated in favor of likes |
57 | 57 | unset($data['hearted'], $data['hearts'], $data['num_hearts']); |
58 | 58 | parent::_setData($data); |
59 | 59 | } |
60 | 60 | |
61 | - final public function isAssignment (): bool { |
|
61 | + final public function isAssignment(): bool { |
|
62 | 62 | return $this->getResourceSubtype() === self::TYPE_ASSIGNED; |
63 | 63 | } |
64 | 64 | |
65 | - final public function isComment (): bool { |
|
65 | + final public function isComment(): bool { |
|
66 | 66 | return $this->getResourceSubtype() === self::TYPE_COMMENT_ADDED; |
67 | 67 | } |
68 | 68 | |
69 | - final public function isDueDate (): bool { |
|
69 | + final public function isDueDate(): bool { |
|
70 | 70 | return $this->getResourceSubtype() === self::TYPE_DUE_DATE_CHANGED; |
71 | 71 | } |
72 | 72 | |
73 | - public function isEdited (): bool { |
|
73 | + public function isEdited(): bool { |
|
74 | 74 | return $this->_is('is_edited'); |
75 | 75 | } |
76 | 76 | |
77 | - public function isFromApi (): bool { |
|
77 | + public function isFromApi(): bool { |
|
78 | 78 | return $this->getSource() === 'api'; |
79 | 79 | } |
80 | 80 | |
81 | - public function isFromWeb (): bool { |
|
81 | + public function isFromWeb(): bool { |
|
82 | 82 | return $this->getSource() === 'web'; |
83 | 83 | } |
84 | 84 | |
85 | - public function isPinned (): bool { |
|
85 | + public function isPinned(): bool { |
|
86 | 86 | return $this->_is('is_pinned'); |
87 | 87 | } |
88 | 88 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param bool $pinned |
91 | 91 | * @return $this |
92 | 92 | */ |
93 | - public function setPinned (bool $pinned) { |
|
93 | + public function setPinned(bool $pinned) { |
|
94 | 94 | return $this->_set('is_pinned', $pinned); |
95 | 95 | } |
96 | 96 |
@@ -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); |