@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param AbstractEntity $entity |
34 | 34 | */ |
35 | - public function add (AbstractEntity $entity): void { |
|
35 | + public function add(AbstractEntity $entity): void { |
|
36 | 36 | if ($gid = $entity->getGid() and !$entity->isDiff()) { |
37 | 37 | $this->entities[$gid] = $entity; |
38 | 38 | foreach ($this->getKeys($entity) as $key) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param Closure $factory `fn($caller): null|AbstractEntity` |
53 | 53 | * @return null|mixed|AbstractEntity |
54 | 54 | */ |
55 | - public function get (string $key, $caller, Closure $factory) { |
|
55 | + public function get(string $key, $caller, Closure $factory) { |
|
56 | 56 | if ($gid = $this->gids[$key] ?? null) { |
57 | 57 | return $this->entities[$gid]; |
58 | 58 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @param AbstractEntity $entity |
82 | 82 | * @return string[] |
83 | 83 | */ |
84 | - protected function getKeys (AbstractEntity $entity) { |
|
84 | + protected function getKeys(AbstractEntity $entity) { |
|
85 | 85 | if (!$gid = $entity->getGid() or $entity->isDiff()) { |
86 | 86 | return []; |
87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @param AbstractEntity $entity |
99 | 99 | */ |
100 | - public function remove (AbstractEntity $entity): void { |
|
100 | + public function remove(AbstractEntity $entity): void { |
|
101 | 101 | unset($this->entities[$entity->getGid()]); |
102 | 102 | foreach ($this->getKeys($entity) as $key) { |
103 | 103 | unset($this->gids[$key]); |
@@ -12,5 +12,5 @@ |
||
12 | 12 | * @param string $path |
13 | 13 | * @param null|array $payload |
14 | 14 | */ |
15 | - public function log (string $info, string $path, ?array $payload): void; |
|
15 | + public function log(string $info, string $path, ?array $payload): void; |
|
16 | 16 | } |
17 | 17 | \ No newline at end of file |
@@ -11,11 +11,11 @@ |
||
11 | 11 | |
12 | 12 | const NAME = 'asana'; |
13 | 13 | |
14 | - public function boot () { |
|
14 | + public function boot() { |
|
15 | 15 | $this->mergeConfigFrom(App::configPath('asana.php'), self::NAME); |
16 | 16 | } |
17 | 17 | |
18 | - public function register () { |
|
18 | + public function register() { |
|
19 | 19 | $this->app->singleton(self::NAME, function($app) { |
20 | 20 | $config = $app->config->get(self::NAME); |
21 | 21 | return new Api($config['token']); |
@@ -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 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | /** |
14 | 14 | * `DELETE` |
15 | 15 | */ |
16 | - public function delete (): void { |
|
16 | + public function delete(): void { |
|
17 | 17 | /** @var Api $api */ |
18 | 18 | $api = $this->api; |
19 | 19 | $api->delete($this); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * @return $this |
17 | 17 | */ |
18 | - public function update () { |
|
18 | + public function update() { |
|
19 | 19 | if ($this->isDiff()) { |
20 | 20 | /** @var Api $api */ |
21 | 21 | $api = $this->api; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param Api $api |
37 | 37 | * @param PSR16 $cache |
38 | 38 | */ |
39 | - public function __construct (Api $api, PSR16 $cache) { |
|
39 | + public function __construct(Api $api, PSR16 $cache) { |
|
40 | 40 | $this->api = $api; |
41 | 41 | $this->cache = $cache; |
42 | 42 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param AbstractEntity $entity |
46 | 46 | * @throws InvalidArgumentException |
47 | 47 | */ |
48 | - public function add (AbstractEntity $entity): void { |
|
48 | + public function add(AbstractEntity $entity): void { |
|
49 | 49 | if ($gid = $entity->getGid() and !$entity->isDiff()) { |
50 | 50 | parent::add($entity); |
51 | 51 | foreach ($this->getKeys($entity) as $key) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - public function get (string $key, $caller, Closure $factory) { |
|
60 | + public function get(string $key, $caller, Closure $factory) { |
|
61 | 61 | return parent::get($key, $caller, function($caller) use ($key, $factory) { |
62 | 62 | /** @var null|string|AbstractEntity $entity */ |
63 | 63 | if ($entity = $this->cache->get($key)) { // hit? |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param Api|Data $caller |
102 | 102 | * @return AbstractEntity |
103 | 103 | */ |
104 | - protected function hydrate (AbstractEntity $proto, $caller) { |
|
104 | + protected function hydrate(AbstractEntity $proto, $caller) { |
|
105 | 105 | return $this->api->factory(get_class($proto), $caller, $proto->toArray()); |
106 | 106 | } |
107 | 107 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @param AbstractEntity $entity |
110 | 110 | * @throws InvalidArgumentException |
111 | 111 | */ |
112 | - public function remove (AbstractEntity $entity): void { |
|
112 | + public function remove(AbstractEntity $entity): void { |
|
113 | 113 | parent::remove($entity); |
114 | 114 | $this->cache->deleteMultiple($this->getKeys($entity)); |
115 | 115 | } |
@@ -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 | * @depends 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); |
@@ -49,21 +49,21 @@ |
||
49 | 49 | /** |
50 | 50 | * @return Api |
51 | 51 | */ |
52 | - final public static function getApi () { |
|
52 | + final public static function getApi() { |
|
53 | 53 | return static::getFacadeRoot(); |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @return string |
58 | 58 | */ |
59 | - public static function getFacadeAccessor () { |
|
59 | + public static function getFacadeAccessor() { |
|
60 | 60 | return AsanaServiceProvider::NAME; |
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * @return Api |
65 | 65 | */ |
66 | - public static function getFacadeRoot () { |
|
66 | + public static function getFacadeRoot() { |
|
67 | 67 | return parent::getFacadeRoot(); |
68 | 68 | } |
69 | 69 | } |
70 | 70 | \ No newline at end of file |