Passed
Push — master ( 8f2f39...434123 )
by y
01:50
created
src/Workspace.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @return string
40 40
      */
41
-    final public function __toString (): string {
41
+    final public function __toString(): string {
42 42
         return "workspaces/{$this->getGid()}";
43 43
     }
44 44
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @return OrganizationExport
51 51
      */
52
-    public function export () {
52
+    public function export() {
53 53
         /** @var OrganizationExport $export */
54 54
         $export = $this->api->factory($this, OrganizationExport::class);
55 55
         return $export->create($this);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param int $limit 1-100
70 70
      * @return array|AbstractEntity[]
71 71
      */
72
-    protected function find (string $class, string $text, int $limit = 20) {
72
+    protected function find(string $class, string $text, int $limit = 20) {
73 73
         return $this->api->loadAll($this, $class, "{$this}/typeahead", [
74 74
             'resource_type' => $class::TYPE,
75 75
             'query' => $text,
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      * @param int $limit 1-100
85 85
      * @return CustomField[]
86 86
      */
87
-    public function findCustomFields (string $text, int $limit = 20) {
87
+    public function findCustomFields(string $text, int $limit = 20) {
88 88
         return $this->find(CustomField::class, $text, $limit);
89 89
     }
90 90
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @param int $limit 1-100
96 96
      * @return Portfolio[]
97 97
      */
98
-    public function findPortfolios (string $text, int $limit = 20) {
98
+    public function findPortfolios(string $text, int $limit = 20) {
99 99
         return $this->find(Portfolio::class, $text, $limit);
100 100
     }
101 101
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      * @param int $limit 1-100
107 107
      * @return Project[]
108 108
      */
109
-    public function findProjects (string $text, int $limit = 20) {
109
+    public function findProjects(string $text, int $limit = 20) {
110 110
         return $this->find(Project::class, $text, $limit);
111 111
     }
112 112
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * @param int $limit 1-100
118 118
      * @return Tag[]
119 119
      */
120
-    public function findTags (string $text, int $limit = 20) {
120
+    public function findTags(string $text, int $limit = 20) {
121 121
         return $this->find(Tag::class, $text, $limit);
122 122
     }
123 123
 
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
      * @param int $limit 1-100
129 129
      * @return Task[]
130 130
      */
131
-    public function findTasks (string $text, int $limit = 20) {
131
+    public function findTasks(string $text, int $limit = 20) {
132 132
         return $this->find(Task::class, $text, $limit);
133 133
     }
134 134
 
135 135
     /**
136 136
      * @return CustomField[]
137 137
      */
138
-    public function getCustomFields () {
138
+    public function getCustomFields() {
139 139
         return $this->api->loadAll($this, CustomField::class, "{$this}/custom_fields");
140 140
     }
141 141
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      *
145 145
      * @return Portfolio[]
146 146
      */
147
-    public function getPortfolios () {
147
+    public function getPortfolios() {
148 148
         return $this->api->loadAll($this, Portfolio::class, "portfolios", [
149 149
             'workspace' => $this->getGid(),
150 150
             'owner' => $this->api->getMe()->getGid() // the only allowed value, but still required.
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @param array $filter
158 158
      * @return Project[]
159 159
      */
160
-    public function getProjects (array $filter = Project::GET_ACTIVE) {
160
+    public function getProjects(array $filter = Project::GET_ACTIVE) {
161 161
         $filter['workspace'] = $this->getGid();
162 162
         return $this->api->loadAll($this, Project::class, 'projects', $filter);
163 163
     }
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
     /**
166 166
      * @return Tag[]
167 167
      */
168
-    public function getTags () {
168
+    public function getTags() {
169 169
         return $this->api->loadAll($this, Tag::class, 'tags', ['workspace' => $this->getGid()]);
170 170
     }
171 171
 
172 172
     /**
173 173
      * @return Team[]
174 174
      */
175
-    public function getTeams () {
175
+    public function getTeams() {
176 176
         return $this->api->loadAll($this, Team::class, "organizations/{$this->getGid()}/teams");
177 177
     }
178 178
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      * @param string $email
181 181
      * @return null|User
182 182
      */
183
-    public function getUserByEmail (string $email) {
183
+    public function getUserByEmail(string $email) {
184 184
         return $this->api->getPool()->get("users/{$email}", $this, function() use ($email) {
185 185
             foreach ($this->getUsers() as $user) {
186 186
                 if ($user->getEmail() === $email) {
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
     /**
195 195
      * @return User[]
196 196
      */
197
-    public function getUsers () {
197
+    public function getUsers() {
198 198
         return $this->api->loadAll($this, User::class, "{$this}/users");
199 199
     }
200 200
 
201 201
     /**
202 202
      * @return ProjectWebhook[]|TaskWebhook[]
203 203
      */
204
-    public function getWebhooks () {
204
+    public function getWebhooks() {
205 205
         /** @var array $all */
206 206
         $all = $this->api->get('webhooks', ['workspace' => $this->getGid()], ['expand' => 'this']);
207 207
         return array_map(function(array $each) {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     /**
219 219
      * @return bool
220 220
      */
221
-    final public function isOrganization (): bool {
221
+    final public function isOrganization(): bool {
222 222
         return $this->_is('is_organization');
223 223
     }
224 224
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      *
228 228
      * @return CustomField
229 229
      */
230
-    public function newCustomField () {
230
+    public function newCustomField() {
231 231
         /** @var CustomField $field */
232 232
         $field = $this->api->factory($this, CustomField::class);
233 233
         return $field->setWorkspace($this);
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      *
239 239
      * @return Portfolio
240 240
      */
241
-    public function newPortfolio () {
241
+    public function newPortfolio() {
242 242
         /** @var Portfolio $portfolio */
243 243
         $portfolio = $this->api->factory($this, Portfolio::class);
244 244
         return $portfolio->setWorkspace($this);
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      *
250 250
      * @return Project
251 251
      */
252
-    public function newProject () {
252
+    public function newProject() {
253 253
         /** @var Project $project */
254 254
         $project = $this->api->factory($this, Project::class);
255 255
         return $project->setWorkspace($this);
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      *
261 261
      * @return Tag
262 262
      */
263
-    public function newTag () {
263
+    public function newTag() {
264 264
         /** @var Tag $tag */
265 265
         $tag = $this->api->factory($this, Tag::class);
266 266
         return $tag->setWorkspace($this);
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      *
272 272
      * @return Task
273 273
      */
274
-    public function newTask () {
274
+    public function newTask() {
275 275
         /** @var Task $task */
276 276
         $task = $this->api->factory($this, Task::class);
277 277
         return $task->setWorkspace($this);
Please login to merge, or discard this patch.
src/Project/Status.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @param Project $project
51 51
      * @param array $data
52 52
      */
53
-    public function __construct (Project $project, array $data = []) {
53
+    public function __construct(Project $project, array $data = []) {
54 54
         $this->project = $project;
55 55
         parent::__construct($project, $data);
56 56
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @return string
62 62
      */
63
-    final public function __toString (): string {
63
+    final public function __toString(): string {
64 64
         return "project_statuses/{$this->getGid()}";
65 65
     }
66 66
 
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
      *
70 70
      * @return string
71 71
      */
72
-    final protected function _getDir (): string {
72
+    final protected function _getDir(): string {
73 73
         return "{$this->project}/project_statuses";
74 74
     }
75 75
 
76
-    protected function _setData (array $data): void {
76
+    protected function _setData(array $data): void {
77 77
         // redundant, prefer created_by
78 78
         unset($data['author']);
79 79
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     /**
84 84
      * @return Project
85 85
      */
86
-    public function getProject () {
86
+    public function getProject() {
87 87
         return $this->project;
88 88
     }
89 89
 }
90 90
\ No newline at end of file
Please login to merge, or discard this patch.
src/Project/Section.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
      *
37 37
      * @return string
38 38
      */
39
-    final public function __toString (): string {
39
+    final public function __toString(): string {
40 40
         return "sections/{$this->getGid()}";
41 41
     }
42 42
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @return string
47 47
      */
48
-    final protected function _getDir (): string {
48
+    final protected function _getDir(): string {
49 49
         return "{$this->getProject()}/sections";
50 50
     }
51 51
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param array $filter
54 54
      * @return Traversable|Task[]
55 55
      */
56
-    public function getIterator (array $filter = Task::GET_INCOMPLETE) {
56
+    public function getIterator(array $filter = Task::GET_INCOMPLETE) {
57 57
         $filter['section'] = $this->getGid();
58 58
         return $this->api->loadEach($this, Task::class, 'tasks', $filter);
59 59
     }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param array $filter
63 63
      * @return Task[]
64 64
      */
65
-    public function getTasks (array $filter = Task::GET_INCOMPLETE) {
65
+    public function getTasks(array $filter = Task::GET_INCOMPLETE) {
66 66
         return iterator_to_array($this->getIterator($filter));
67 67
     }
68 68
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @depends after-create
73 73
      * @return Task
74 74
      */
75
-    public function newTask () {
75
+    public function newTask() {
76 76
         /** @var Task $task */
77 77
         $task = $this->api->factory($this, Task::class);
78 78
         return $task->addToProject($this);
Please login to merge, or discard this patch.
src/CustomField.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return string
50 50
      */
51
-    final public function __toString (): string {
51
+    final public function __toString(): string {
52 52
         return "custom_fields/{$this->getGid()}";
53 53
     }
54 54
 
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * @return string
59 59
      */
60
-    final protected function _getDir (): string {
60
+    final protected function _getDir(): string {
61 61
         return 'custom_fields';
62 62
     }
63 63
 
64
-    protected function _setData (array $data): void {
64
+    protected function _setData(array $data): void {
65 65
         // strip out field entry values if present.
66 66
         $data = array_intersect_key($data, array_flip([
67 67
             'gid',
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @param string $name
83 83
      * @return EnumOption
84 84
      */
85
-    public function addEnumOption (string $name) {
85
+    public function addEnumOption(string $name) {
86 86
         /** @var EnumOption $option */
87 87
         $option = $this->api->factory($this, EnumOption::class);
88 88
         $option->setName($name);
@@ -98,35 +98,35 @@  discard block
 block discarded – undo
98 98
     /**
99 99
      * @return bool
100 100
      */
101
-    final public function hasNotificationsEnabled (): bool {
101
+    final public function hasNotificationsEnabled(): bool {
102 102
         return $this->_is('has_notifications_enabled');
103 103
     }
104 104
 
105 105
     /**
106 106
      * @return bool
107 107
      */
108
-    final public function isEnum (): bool {
108
+    final public function isEnum(): bool {
109 109
         return $this->getResourceSubtype() === self::TYPE_ENUM;
110 110
     }
111 111
 
112 112
     /**
113 113
      * @return bool
114 114
      */
115
-    final public function isGlobalToWorkspace (): bool {
115
+    final public function isGlobalToWorkspace(): bool {
116 116
         return $this->_is('is_global_to_workspace');
117 117
     }
118 118
 
119 119
     /**
120 120
      * @return bool
121 121
      */
122
-    final public function isNumber (): bool {
122
+    final public function isNumber(): bool {
123 123
         return $this->getResourceSubtype() === self::TYPE_NUMBER;
124 124
     }
125 125
 
126 126
     /**
127 127
      * @return bool
128 128
      */
129
-    final public function isText (): bool {
129
+    final public function isText(): bool {
130 130
         return $this->getResourceSubtype() === self::TYPE_TEXT;
131 131
     }
132 132
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @param bool $flag
135 135
      * @return $this
136 136
      */
137
-    final public function setGlobalToWorkspace (bool $flag) {
137
+    final public function setGlobalToWorkspace(bool $flag) {
138 138
         return $this->_set('is_global_to_workspace', $flag);
139 139
     }
140 140
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @param bool $flag
143 143
      * @return $this
144 144
      */
145
-    final public function setNotificationsEnabled (bool $flag) {
145
+    final public function setNotificationsEnabled(bool $flag) {
146 146
         return $this->_set('has_notifications_enabled', $flag);
147 147
     }
148 148
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @param callable $cmp `fn( EnumOption $a, EnumOption $b ): int`
151 151
      * @return $this
152 152
      */
153
-    public function sortEnumOptions (callable $cmp) {
153
+    public function sortEnumOptions(callable $cmp) {
154 154
         if ($options = $this->getEnumOptions()) {
155 155
             $prev = $options[0]; // first option on remote
156 156
             usort($options, $cmp);
Please login to merge, or discard this patch.
src/Workspace/WorkspaceTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      * @param Workspace $workspace
21 21
      * @return $this
22 22
      */
23
-    final public function setWorkspace (Workspace $workspace) {
23
+    final public function setWorkspace(Workspace $workspace) {
24 24
         return $this->_set('workspace', $workspace);
25 25
     }
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/Workspace/OrganizationExport.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @return string
40 40
      */
41
-    final public function __toString (): string {
41
+    final public function __toString(): string {
42 42
         return "organization_exports/{$this->getGid()}";
43 43
     }
44 44
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      *
48 48
      * @return string
49 49
      */
50
-    final protected function _getDir (): string {
50
+    final protected function _getDir(): string {
51 51
         return "organization_exports";
52 52
     }
53 53
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param Workspace $organization
56 56
      * @return $this
57 57
      */
58
-    public function create (Workspace $organization) {
58
+    public function create(Workspace $organization) {
59 59
         $this->_set('organization', $organization);
60 60
         return $this->_create();
61 61
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      *
66 66
      * @return bool
67 67
      */
68
-    final public function isActive (): bool {
68
+    final public function isActive(): bool {
69 69
         return $this->getState() === self::STATE_ACTIVE;
70 70
     }
71 71
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @return bool
76 76
      */
77
-    final public function isDone (): bool {
77
+    final public function isDone(): bool {
78 78
         return $this->isSuccessful() or $this->isFailed();
79 79
     }
80 80
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @return bool
85 85
      */
86
-    final public function isFailed (): bool {
86
+    final public function isFailed(): bool {
87 87
         return $this->getState() === self::STATE_FAIL;
88 88
     }
89 89
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @return bool
94 94
      */
95
-    final public function isQueued (): bool {
95
+    final public function isQueued(): bool {
96 96
         return $this->getState() === self::STATE_QUEUED;
97 97
     }
98 98
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      *
102 102
      * @return bool
103 103
      */
104
-    final public function isSuccessful (): bool {
104
+    final public function isSuccessful(): bool {
105 105
         return $this->getState() === self::STATE_SUCCESS;
106 106
     }
107 107
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @param callable $spinner `fn( OrganizationExport $this ): void`
114 114
      * @return $this
115 115
      */
116
-    public function wait (callable $spinner = null) {
116
+    public function wait(callable $spinner = null) {
117 117
         while (!$this->isDone()) {
118 118
             if ($spinner) {
119 119
                 call_user_func($spinner, $this);
Please login to merge, or discard this patch.
src/Event/Change.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected $key;
42 42
 
43
-    protected function _setData (array $data): void {
43
+    protected function _setData(array $data): void {
44 44
         $this->key = [
45 45
             Event::ACTION_ADDED => 'added_value',
46 46
             Event::ACTION_REMOVED => 'removed_value',
@@ -67,35 +67,35 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @return null|User|Project|Section|Task|FieldEntry|Attachment|Story|Like
69 69
      */
70
-    public function getPayload () {
70
+    public function getPayload() {
71 71
         return $this->data[$this->key];
72 72
     }
73 73
 
74 74
     /**
75 75
      * @return bool
76 76
      */
77
-    final public function hasPayload (): bool {
77
+    final public function hasPayload(): bool {
78 78
         return isset($this->data[$this->key]);
79 79
     }
80 80
 
81 81
     /**
82 82
      * @return bool
83 83
      */
84
-    final public function wasAddition (): bool {
84
+    final public function wasAddition(): bool {
85 85
         return $this->getAction() === Event::ACTION_ADDED;
86 86
     }
87 87
 
88 88
     /**
89 89
      * @return bool
90 90
      */
91
-    final public function wasRemoval (): bool {
91
+    final public function wasRemoval(): bool {
92 92
         return $this->getAction() === Event::ACTION_REMOVED;
93 93
     }
94 94
 
95 95
     /**
96 96
      * @return bool
97 97
      */
98
-    final public function wasValue (): bool {
98
+    final public function wasValue(): bool {
99 99
         return $this->getAction() === Event::ACTION_CHANGED;
100 100
     }
101 101
 
Please login to merge, or discard this patch.
src/Team.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return string
32 32
      */
33
-    final public function __toString (): string {
33
+    final public function __toString(): string {
34 34
         return "teams/{$this->getGid()}";
35 35
     }
36 36
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param User $user
39 39
      * @return $this
40 40
      */
41
-    public function addUser (User $user) {
41
+    public function addUser(User $user) {
42 42
         $this->api->post("{$this}/addUser", ['user' => $user->getGid()]);
43 43
         return $this;
44 44
     }
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
      * @param array $filter
52 52
      * @return Project[]
53 53
      */
54
-    public function getProjects (array $filter = Project::GET_ACTIVE) {
54
+    public function getProjects(array $filter = Project::GET_ACTIVE) {
55 55
         return $this->api->loadAll($this, Project::class, "{$this}/projects", $filter);
56 56
     }
57 57
 
58
-    public function getUrl (): string {
58
+    public function getUrl(): string {
59 59
         return "https://app.asana.com/0/{$this->getGid()}/overview";
60 60
     }
61 61
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @return User[]
68 68
      */
69
-    public function getUsers () {
69
+    public function getUsers() {
70 70
         return $this->api->loadAll($this, User::class, "{$this}/users");
71 71
     }
72 72
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @param User $user
75 75
      * @return $this
76 76
      */
77
-    public function removeUser (User $user) {
77
+    public function removeUser(User $user) {
78 78
         $this->api->post("{$this}/removeUser", ['user' => $user->getGid()]);
79 79
         return $this;
80 80
     }
Please login to merge, or discard this patch.
src/Tag.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      *
44 44
      * @return string
45 45
      */
46
-    final public function __toString (): string {
46
+    final public function __toString(): string {
47 47
         return "tags/{$this->getGid()}";
48 48
     }
49 49
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return string
54 54
      */
55
-    final protected function _getDir (): string {
55
+    final protected function _getDir(): string {
56 56
         return 'tags';
57 57
     }
58 58
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * @param array $filter
61 61
      * @return Traversable|Task[]
62 62
      */
63
-    public function getIterator (array $filter = Task::GET_INCOMPLETE) {
63
+    public function getIterator(array $filter = Task::GET_INCOMPLETE) {
64 64
         return $this->api->loadEach($this, Task::class, "{$this}/tasks", $filter);
65 65
     }
66 66
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param array $filter
69 69
      * @return Task[]
70 70
      */
71
-    public function getTasks (array $filter = Task::GET_INCOMPLETE) {
71
+    public function getTasks(array $filter = Task::GET_INCOMPLETE) {
72 72
         return iterator_to_array($this->getIterator($filter));
73 73
     }
74 74
 }
75 75
\ No newline at end of file
Please login to merge, or discard this patch.