Passed
Push — master ( 7073d8...993609 )
by y
01:42
created
src/Api/Cache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param AbstractEntity $entity
35 35
      * @return bool Success
36 36
      */
37
-    public function add (AbstractEntity $entity): bool {
37
+    public function add(AbstractEntity $entity): bool {
38 38
         if ($gid = $entity->getGid() and !$entity->isDiff()) {
39 39
             $this->entities[$gid] = $entity;
40 40
             $this->addKeys($gid, $entity->getCacheKeys());
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * @param string $gid
50 50
      * @param string[] $keys
51 51
      */
52
-    protected function addKeys (string $gid, array $keys): void {
52
+    protected function addKeys(string $gid, array $keys): void {
53 53
         $this->gids += array_fill_keys($keys, $gid);
54 54
     }
55 55
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param Closure $factory `fn($caller): null|AbstractEntity`
65 65
      * @return null|mixed|AbstractEntity
66 66
      */
67
-    public function get (string $key, $caller, Closure $factory) {
67
+    public function get(string $key, $caller, Closure $factory) {
68 68
         // POOL HIT
69 69
         if ($gid = $this->gids[$key] ?? null) {
70 70
             return $this->entities[$gid];
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @param AbstractEntity $entity
94 94
      */
95
-    public function remove (AbstractEntity $entity): void {
95
+    public function remove(AbstractEntity $entity): void {
96 96
         $gid = $entity->getGid();
97 97
         unset($this->entities[$gid]);
98 98
         foreach ($entity->getCacheKeys() as $key) {
Please login to merge, or discard this patch.
src/Api/SimpleCache.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             // dereference gid?
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return DateInterval
122 122
      */
123
-    public function getTtl () {
123
+    public function getTtl() {
124 124
         return $this->ttl;
125 125
     }
126 126
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      * @param AbstractEntity $entity
129 129
      * @throws InvalidArgumentException
130 130
      */
131
-    public function remove (AbstractEntity $entity): void {
131
+    public function remove(AbstractEntity $entity): void {
132 132
         parent::remove($entity);
133 133
         foreach ($entity->getCacheKeys() as $key) {
134 134
             $this->_delete($key);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      * @param DateInterval $ttl
140 140
      * @return $this
141 141
      */
142
-    public function setTtl (DateInterval $ttl) {
142
+    public function setTtl(DateInterval $ttl) {
143 143
         $this->ttl = $ttl;
144 144
         return $this;
145 145
     }
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
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         'workspaces' => [Workspace::class]
29 29
     ];
30 30
 
31
-    final public function __toString (): string {
31
+    final public function __toString(): string {
32 32
         return "users/{$this->getGid()}";
33 33
     }
34 34
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @param Workspace $workspace
37 37
      * @return $this
38 38
      */
39
-    public function addToWorkspace (Workspace $workspace) {
39
+    public function addToWorkspace(Workspace $workspace) {
40 40
         $this->api->post("{$workspace}/addUser", ['user' => $this->getGid()]);
41 41
         $this->_merge('workspaces', [$workspace]);
42 42
         return $this;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     /**
46 46
      * @return string[]
47 47
      */
48
-    public function getCacheKeys () {
48
+    public function getCacheKeys() {
49 49
         $keys = parent::getCacheKeys();
50 50
 
51 51
         // only include email as a key if it's loaded
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * @param Workspace $workspace
61 61
      * @return Portfolio[]
62 62
      */
63
-    public function getFavoritePortfolios (Workspace $workspace) {
63
+    public function getFavoritePortfolios(Workspace $workspace) {
64 64
         return $this->getFavorites(Portfolio::class, Portfolio::TYPE, $workspace);
65 65
     }
66 66
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param Workspace $workspace
69 69
      * @return Project[]
70 70
      */
71
-    public function getFavoriteProjects (Workspace $workspace) {
71
+    public function getFavoriteProjects(Workspace $workspace) {
72 72
         return $this->getFavorites(Project::class, Project::TYPE, $workspace);
73 73
     }
74 74
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @param Workspace $workspace
77 77
      * @return Tag[]
78 78
      */
79
-    public function getFavoriteTags (Workspace $workspace) {
79
+    public function getFavoriteTags(Workspace $workspace) {
80 80
         return $this->getFavorites(Tag::class, Tag::TYPE, $workspace);
81 81
     }
82 82
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      * @param Workspace $workspace
85 85
      * @return Team[]
86 86
      */
87
-    public function getFavoriteTeams (Workspace $workspace) {
87
+    public function getFavoriteTeams(Workspace $workspace) {
88 88
         return $this->getFavorites(Team::class, Team::TYPE, $workspace);
89 89
     }
90 90
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      * @param Workspace $workspace
93 93
      * @return User[]
94 94
      */
95
-    public function getFavoriteUsers (Workspace $workspace) {
95
+    public function getFavoriteUsers(Workspace $workspace) {
96 96
         return $this->getFavorites(self::class, self::TYPE, $workspace);
97 97
     }
98 98
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @param Workspace $workspace
103 103
      * @return array
104 104
      */
105
-    protected function getFavorites (string $class, string $resourceType, Workspace $workspace) {
105
+    protected function getFavorites(string $class, string $resourceType, Workspace $workspace) {
106 106
         return $this->loadAll($class, "{$this}/favorites", [
107 107
             'resource_type' => $resourceType,
108 108
             'workspace' => $workspace->getGid()
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * @param Workspace $workspace
118 118
      * @return Task[]
119 119
      */
120
-    public function getIncompleteTasks (Workspace $workspace) {
120
+    public function getIncompleteTasks(Workspace $workspace) {
121 121
         return $this->loadAll(Task::class, 'tasks', [
122 122
             'assignee' => $this->getGid(),
123 123
             'workspace' => $workspace->getGid(),
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      * @param Workspace $workspace
130 130
      * @return Portfolio[]
131 131
      */
132
-    public function getPortfolios (Workspace $workspace) {
132
+    public function getPortfolios(Workspace $workspace) {
133 133
         return $this->loadAll(Portfolio::class, "portfolios", [
134 134
             'workspace' => $workspace->getGid(),
135 135
             'owner' => $this->getGid()
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      * @param Workspace $workspace
141 141
      * @return TaskList
142 142
      */
143
-    public function getTaskList (Workspace $workspace) {
143
+    public function getTaskList(Workspace $workspace) {
144 144
         return $this->load(TaskList::class, "{$this}/user_task_list", [
145 145
             'workspace' => $workspace->getGid()
146 146
         ]);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      * @param string[] $filter
156 156
      * @return Task[]
157 157
      */
158
-    public function getTasks (Workspace $workspace, array $filter = []) {
158
+    public function getTasks(Workspace $workspace, array $filter = []) {
159 159
         $filter['assignee'] = $this->getGid();
160 160
         $filter['workspace'] = $workspace->getGid();
161 161
         return $this->loadAll(Task::class, 'tasks', $filter);
@@ -165,13 +165,13 @@  discard block
 block discarded – undo
165 165
      * @param Workspace $organization
166 166
      * @return Team[]
167 167
      */
168
-    public function getTeams (Workspace $organization) {
168
+    public function getTeams(Workspace $organization) {
169 169
         return $this->loadAll(Team::class, "{$this}/teams", [
170 170
             'organization' => $organization->getGid()
171 171
         ]);
172 172
     }
173 173
 
174
-    public function getUrl (): string {
174
+    public function getUrl(): string {
175 175
         return "https://app.asana.com/0/{$this->getGid()}/list";
176 176
     }
177 177
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      * @param Workspace $workspace
180 180
      * @return $this
181 181
      */
182
-    public function removeFromWorkspace (Workspace $workspace) {
182
+    public function removeFromWorkspace(Workspace $workspace) {
183 183
         $this->api->post("{$workspace}/removeUser", ['user' => $this->getGid()]);
184 184
         $this->_remove('workspaces', [$workspace]);
185 185
         return $this;
Please login to merge, or discard this patch.