@@ -51,20 +51,20 @@ discard block |
||
51 | 51 | * @param Project $project |
52 | 52 | * @param array $data |
53 | 53 | */ |
54 | - public function __construct (Project $project, array $data = []) { |
|
54 | + public function __construct(Project $project, array $data = []) { |
|
55 | 55 | parent::__construct($project, $data); |
56 | 56 | $this->project = $project; |
57 | 57 | } |
58 | 58 | |
59 | - final public function __toString (): string { |
|
59 | + final public function __toString(): string { |
|
60 | 60 | return "project_statuses/{$this->getGid()}"; |
61 | 61 | } |
62 | 62 | |
63 | - final protected function _getDir (): string { |
|
63 | + final protected function _getDir(): string { |
|
64 | 64 | return "{$this->project}/project_statuses"; |
65 | 65 | } |
66 | 66 | |
67 | - protected function _setData (array $data): void { |
|
67 | + protected function _setData(array $data): void { |
|
68 | 68 | // redundant, prefer created_by |
69 | 69 | unset($data['author']); |
70 | 70 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * @return Project |
76 | 76 | */ |
77 | - public function getProject () { |
|
77 | + public function getProject() { |
|
78 | 78 | return $this->project; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | const NAME = 'asana'; |
19 | 19 | |
20 | - public function boot () { |
|
20 | + public function boot() { |
|
21 | 21 | $this->publishes([ |
22 | 22 | __DIR__ . '/config/asana.php' => $this->app->configPath('asana.php') |
23 | 23 | ]); |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | - public function provides () { |
|
33 | + public function provides() { |
|
34 | 34 | return [self::NAME]; |
35 | 35 | } |
36 | 36 | |
37 | - public function register () { |
|
37 | + public function register() { |
|
38 | 38 | $this->app->singleton(self::NAME, function(Application $app) { |
39 | 39 | $config = $app['config'][self::NAME]; |
40 | 40 | $pool = null; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | protected $curlInfo; |
22 | 22 | |
23 | - public function __construct (int $code, string $message, array $curlInfo) { |
|
23 | + public function __construct(int $code, string $message, array $curlInfo) { |
|
24 | 24 | parent::__construct($message, $code); |
25 | 25 | $this->curlInfo = $curlInfo; |
26 | 26 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * @return array |
30 | 30 | */ |
31 | - public function getCurlInfo (): array { |
|
31 | + public function getCurlInfo(): array { |
|
32 | 32 | return $this->curlInfo; |
33 | 33 | } |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @param AbstractEntity $entity |
31 | 31 | */ |
32 | - protected function _add (AbstractEntity $entity): void { |
|
32 | + protected function _add(AbstractEntity $entity): void { |
|
33 | 33 | $gid = $entity->getGid(); |
34 | 34 | $this->entities[$gid] = $entity; |
35 | 35 | $this->gids[$gid] = $gid; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @param AbstractEntity $entity |
40 | 40 | * @param string[] $keys |
41 | 41 | */ |
42 | - protected function _addKeys (AbstractEntity $entity, ...$keys): void { |
|
42 | + protected function _addKeys(AbstractEntity $entity, ...$keys): void { |
|
43 | 43 | $this->gids += array_fill_keys($keys, $entity->getGid()); |
44 | 44 | } |
45 | 45 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param Api|Data $caller For hydration if needed. |
49 | 49 | * @return null|AbstractEntity |
50 | 50 | */ |
51 | - protected function _get (string $key, $caller) { |
|
51 | + protected function _get(string $key, $caller) { |
|
52 | 52 | if (isset($this->gids[$key])) { |
53 | 53 | return $this->entities[$this->gids[$key]]; |
54 | 54 | } |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | * @param string $key |
63 | 63 | * @return bool |
64 | 64 | */ |
65 | - protected function _has (string $key): bool { |
|
65 | + protected function _has(string $key): bool { |
|
66 | 66 | return isset($this->gids[$key]); |
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
70 | 70 | * @param AbstractEntity $entity |
71 | 71 | */ |
72 | - final public function add (AbstractEntity $entity): void { |
|
72 | + final public function add(AbstractEntity $entity): void { |
|
73 | 73 | if (!$entity->isDiff()) { |
74 | 74 | $this->_add($entity); |
75 | 75 | $this->_addKeys($entity, ...$entity->getPoolKeys()); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param Closure $factory `fn( Api|Data $caller ): null|AbstractEntity` |
83 | 83 | * @return null|mixed|AbstractEntity |
84 | 84 | */ |
85 | - final public function get (string $key, $caller, Closure $factory) { |
|
85 | + final public function get(string $key, $caller, Closure $factory) { |
|
86 | 86 | /** @var AbstractEntity $entity */ |
87 | 87 | if (!$entity = $this->_get($key, $caller) and $entity = $factory($caller)) { |
88 | 88 | $gid = $entity->getGid(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * @param string[] $keys |
105 | 105 | */ |
106 | - public function remove (array $keys): void { |
|
106 | + public function remove(array $keys): void { |
|
107 | 107 | foreach ($keys as $key) { |
108 | 108 | unset($this->entities[$key]); |
109 | 109 | unset($this->gids[$key]); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | 'custom_field' => CustomField::class, |
24 | 24 | ]; |
25 | 25 | |
26 | - protected function _setData (array $data): void { |
|
26 | + protected function _setData(array $data): void { |
|
27 | 27 | // these are the only fields that matter. |
28 | 28 | parent::_setData([ |
29 | 29 | 'custom_field' => $data['custom_field'], |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ]); |
32 | 32 | } |
33 | 33 | |
34 | - final public function getResourceType (): string { |
|
34 | + final public function getResourceType(): string { |
|
35 | 35 | return self::TYPE; |
36 | 36 | } |
37 | 37 | } |
38 | 38 | \ No newline at end of file |
@@ -44,46 +44,46 @@ 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 were deprecated for likes |
57 | 57 | unset($data['hearted'], $data['hearts'], $data['num_hearts']); |
58 | 58 | |
59 | 59 | parent::_setData($data); |
60 | 60 | } |
61 | 61 | |
62 | - final public function isAssignment (): bool { |
|
62 | + final public function isAssignment(): bool { |
|
63 | 63 | return $this->getResourceSubtype() === self::TYPE_ASSIGNED; |
64 | 64 | } |
65 | 65 | |
66 | - final public function isComment (): bool { |
|
66 | + final public function isComment(): bool { |
|
67 | 67 | return $this->getResourceSubtype() === self::TYPE_COMMENT_ADDED; |
68 | 68 | } |
69 | 69 | |
70 | - final public function isDueDate (): bool { |
|
70 | + final public function isDueDate(): bool { |
|
71 | 71 | return $this->getResourceSubtype() === self::TYPE_DUE_DATE_CHANGED; |
72 | 72 | } |
73 | 73 | |
74 | - public function isEdited (): bool { |
|
74 | + public function isEdited(): bool { |
|
75 | 75 | return $this->_is('is_edited'); |
76 | 76 | } |
77 | 77 | |
78 | - public function isFromApi (): bool { |
|
78 | + public function isFromApi(): bool { |
|
79 | 79 | return $this->getSource() === 'api'; |
80 | 80 | } |
81 | 81 | |
82 | - public function isFromWeb (): bool { |
|
82 | + public function isFromWeb(): bool { |
|
83 | 83 | return $this->getSource() === 'web'; |
84 | 84 | } |
85 | 85 | |
86 | - public function isPinned (): bool { |
|
86 | + public function isPinned(): bool { |
|
87 | 87 | return $this->_is('is_pinned'); |
88 | 88 | } |
89 | 89 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @param bool $pinned |
92 | 92 | * @return $this |
93 | 93 | */ |
94 | - public function setPinned (bool $pinned) { |
|
94 | + public function setPinned(bool $pinned) { |
|
95 | 95 | return $this->_set('is_pinned', $pinned); |
96 | 96 | } |
97 | 97 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - public static function random (): string { |
|
38 | + public static function random(): string { |
|
39 | 39 | try { |
40 | 40 | $colors = (new ReflectionClass(self::class))->getConstants(); |
41 | 41 | return $colors[array_rand($colors)]; |
@@ -48,14 +48,14 @@ |
||
48 | 48 | /** |
49 | 49 | * @return Api |
50 | 50 | */ |
51 | - final public static function getApi () { |
|
51 | + final public static function getApi() { |
|
52 | 52 | return static::getFacadeRoot(); |
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @return string |
57 | 57 | */ |
58 | - public static function getFacadeAccessor () { |
|
58 | + public static function getFacadeAccessor() { |
|
59 | 59 | return AsanaServiceProvider::NAME; |
60 | 60 | } |
61 | 61 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * `DELETE` |
16 | 16 | */ |
17 | - public function delete (): void { |
|
17 | + public function delete(): void { |
|
18 | 18 | $this->api->delete($this); |
19 | 19 | $this->api->getPool()->remove($this->getPoolKeys()); |
20 | 20 | } |