Passed
Push — master ( b4f796...2ef625 )
by y
01:41
created
src/Api/Cache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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]);
Please login to merge, or discard this patch.
src/Api/LoggerInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,5 +12,5 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Api/Laravel/AsanaServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 block discarded – undo
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']);
Please login to merge, or discard this patch.
src/Error.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Base/AbstractEntity/DeleteTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Base/AbstractEntity/UpdateTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Api/SimpleCache.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Api/Laravel/Facade/Asana.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,21 +49,21 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/User.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 
24 24
     const TYPE = 'user';
25 25
 
26
-    final public function __toString (): string {
26
+    final public function __toString(): string {
27 27
         return "users/{$this->getGid()}";
28 28
     }
29 29
 
30
-    protected function _getMap (): array {
30
+    protected function _getMap(): array {
31 31
         return [
32 32
             'photo' => Photo::class,
33 33
             'workspaces' => [Workspace::class]
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param Workspace $workspace
39 39
      * @return $this
40 40
      */
41
-    public function addToWorkspace (Workspace $workspace) {
41
+    public function addToWorkspace(Workspace $workspace) {
42 42
         $this->api->post("{$workspace}/addUser", ['user' => $this->getGid()]);
43 43
         $this->_merge('workspaces', [$workspace]);
44 44
         return $this;
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @param Workspace $workspace
49 49
      * @return Portfolio[]
50 50
      */
51
-    public function getFavoritePortfolios (Workspace $workspace) {
51
+    public function getFavoritePortfolios(Workspace $workspace) {
52 52
         return $this->getFavorites(Portfolio::class, Portfolio::TYPE, $workspace);
53 53
     }
54 54
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @param Workspace $workspace
57 57
      * @return Project[]
58 58
      */
59
-    public function getFavoriteProjects (Workspace $workspace) {
59
+    public function getFavoriteProjects(Workspace $workspace) {
60 60
         return $this->getFavorites(Project::class, Project::TYPE, $workspace);
61 61
     }
62 62
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param Workspace $workspace
65 65
      * @return Tag[]
66 66
      */
67
-    public function getFavoriteTags (Workspace $workspace) {
67
+    public function getFavoriteTags(Workspace $workspace) {
68 68
         return $this->getFavorites(Tag::class, Tag::TYPE, $workspace);
69 69
     }
70 70
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @param Workspace $workspace
73 73
      * @return Team[]
74 74
      */
75
-    public function getFavoriteTeams (Workspace $workspace) {
75
+    public function getFavoriteTeams(Workspace $workspace) {
76 76
         return $this->getFavorites(Team::class, Team::TYPE, $workspace);
77 77
     }
78 78
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @param Workspace $workspace
81 81
      * @return User[]
82 82
      */
83
-    public function getFavoriteUsers (Workspace $workspace) {
83
+    public function getFavoriteUsers(Workspace $workspace) {
84 84
         return $this->getFavorites(self::class, self::TYPE, $workspace);
85 85
     }
86 86
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @param Workspace $workspace
91 91
      * @return array
92 92
      */
93
-    protected function getFavorites (string $class, string $resourceType, Workspace $workspace) {
93
+    protected function getFavorites(string $class, string $resourceType, Workspace $workspace) {
94 94
         return $this->loadAll($class, "{$this}/favorites", [
95 95
             'resource_type' => $resourceType,
96 96
             'workspace' => $workspace->getGid()
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      * @param Workspace $workspace
106 106
      * @return Task[]
107 107
      */
108
-    public function getIncompleteTasks (Workspace $workspace) {
108
+    public function getIncompleteTasks(Workspace $workspace) {
109 109
         return $this->loadAll(Task::class, 'tasks', [
110 110
             'assignee' => $this->getGid(),
111 111
             'workspace' => $workspace->getGid(),
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * @param Workspace $workspace
118 118
      * @return Portfolio[]
119 119
      */
120
-    public function getPortfolios (Workspace $workspace) {
120
+    public function getPortfolios(Workspace $workspace) {
121 121
         return $this->loadAll(Portfolio::class, "portfolios", [
122 122
             'workspace' => $workspace->getGid(),
123 123
             'owner' => $this->getGid()
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      * @param Workspace $workspace
129 129
      * @return TaskList
130 130
      */
131
-    public function getTaskList (Workspace $workspace) {
131
+    public function getTaskList(Workspace $workspace) {
132 132
         return $this->load(TaskList::class, "{$this}/user_task_list", [
133 133
             'workspace' => $workspace->getGid()
134 134
         ]);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      * @param string[] $filter
144 144
      * @return Task[]
145 145
      */
146
-    public function getTasks (Workspace $workspace, array $filter = []) {
146
+    public function getTasks(Workspace $workspace, array $filter = []) {
147 147
         $filter['assignee'] = $this->getGid();
148 148
         $filter['workspace'] = $workspace->getGid();
149 149
         return $this->loadAll(Task::class, 'tasks', $filter);
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
      * @param Workspace $organization
154 154
      * @return Team[]
155 155
      */
156
-    public function getTeams (Workspace $organization) {
156
+    public function getTeams(Workspace $organization) {
157 157
         return $this->loadAll(Team::class, "{$this}/teams", [
158 158
             'organization' => $organization->getGid()
159 159
         ]);
160 160
     }
161 161
 
162
-    public function getUrl (): string {
162
+    public function getUrl(): string {
163 163
         return "https://app.asana.com/0/{$this->getGid()}/list";
164 164
     }
165 165
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      * @param Workspace $workspace
168 168
      * @return $this
169 169
      */
170
-    public function removeFromWorkspace (Workspace $workspace) {
170
+    public function removeFromWorkspace(Workspace $workspace) {
171 171
         $this->api->post("{$workspace}/removeUser", ['user' => $this->getGid()]);
172 172
         $this->_remove('workspaces', [$workspace]);
173 173
         return $this;
Please login to merge, or discard this patch.