Skip to content

Commit b5eb3ca

Browse files
lesstifStyleCIBot
andauthored
Apply fixes from StyleCI (#501)
[ci skip] [skip ci] Co-authored-by: StyleCI Bot <[email protected]>
1 parent 2a1c1a7 commit b5eb3ca

File tree

4 files changed

+60
-65
lines changed

4 files changed

+60
-65
lines changed

src/Issue/Version.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace JiraRestApi\Issue;
44

5-
use DateTime;
65
use DateTimeInterface;
76

87
class Version implements \JsonSerializable

src/Project/ProjectService.php

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getAllProjects($paramArray = [])
4545
*
4646
* @return Project
4747
*/
48-
public function get($projectIdOrKey) : Project
48+
public function get($projectIdOrKey): Project
4949
{
5050
$ret = $this->exec($this->uri."/$projectIdOrKey", null);
5151

@@ -65,11 +65,11 @@ public function get($projectIdOrKey) : Project
6565
*
6666
* @param int|string $projectIdOrKey Project Key
6767
*
68-
* @return Reporter[]
6968
*@throws \JiraRestApi\JiraException
7069
*
70+
* @return Reporter[]
7171
*/
72-
public function getAssignable(int|string $projectIdOrKey) : array
72+
public function getAssignable(int|string $projectIdOrKey): array
7373
{
7474
$ret = $this->exec("/user/assignable/search?project=$projectIdOrKey", null);
7575
$json = json_decode($ret);
@@ -83,11 +83,11 @@ public function getAssignable(int|string $projectIdOrKey) : array
8383
/**
8484
* @param int|string $projectIdOrKey
8585
*
86-
* @return IssueType[]
8786
*@throws \JiraRestApi\JiraException
8887
*
88+
* @return IssueType[]
8989
*/
90-
public function getStatuses(int|string $projectIdOrKey) : array
90+
public function getStatuses(int|string $projectIdOrKey): array
9191
{
9292
$ret = $this->exec($this->uri."/$projectIdOrKey/statuses", null);
9393
$json = json_decode($ret);
@@ -103,11 +103,11 @@ public function getStatuses(int|string $projectIdOrKey) : array
103103
*
104104
* @param int|string $projectIdOrKey
105105
*
106-
* @return \JiraRestApi\Component\Component[]
107106
*@throws \JiraRestApi\JiraException
108107
*
108+
* @return \JiraRestApi\Component\Component[]
109109
*/
110-
public function getProjectComponents(int|string $projectIdOrKey) : array
110+
public function getProjectComponents(int|string $projectIdOrKey): array
111111
{
112112
$ret = $this->exec($this->uri."/$projectIdOrKey/components", null);
113113
$json = json_decode($ret);
@@ -123,12 +123,12 @@ public function getProjectComponents(int|string $projectIdOrKey) : array
123123
*
124124
* @param int|string $projectIdOrKey
125125
*
126-
* @return array
127-
* @return array
128126
*@throws JiraException
129127
*
128+
* @return array
129+
* @return array
130130
*/
131-
public function getProjectTransitionsToArray(int|string $projectIdOrKey) : array
131+
public function getProjectTransitionsToArray(int|string $projectIdOrKey): array
132132
{
133133
$ret = $this->exec($this->uri."/$projectIdOrKey/statuses", null);
134134
$json = json_decode($ret);
@@ -157,7 +157,7 @@ public function getProjectTransitionsToArray(int|string $projectIdOrKey) : array
157157
*
158158
* @return ProjectType[]
159159
*/
160-
public function getProjectTypes() : array
160+
public function getProjectTypes(): array
161161
{
162162
$ret = $this->exec($this->uri.'/type');
163163

@@ -174,12 +174,12 @@ public function getProjectTypes() : array
174174
/**
175175
* @param int|string $key
176176
*
177-
* @return ProjectType
178177
*@throws \JsonMapper_Exception
179-
*
180178
* @throws \JiraRestApi\JiraException
179+
*
180+
* @return ProjectType
181181
*/
182-
public function getProjectType(int|string $key) : ProjectType
182+
public function getProjectType(int|string $key): ProjectType
183183
{
184184
$ret = $this->exec($this->uri."/type/$key");
185185

@@ -196,12 +196,12 @@ public function getProjectType(int|string $key) : ProjectType
196196
/**
197197
* @param int|string $key
198198
*
199-
* @return ProjectType
200199
*@throws \JsonMapper_Exception
201-
*
202200
* @throws \JiraRestApi\JiraException
201+
*
202+
* @return ProjectType
203203
*/
204-
public function getAccessibleProjectType(int|string $key) : ProjectType
204+
public function getAccessibleProjectType(int|string $key): ProjectType
205205
{
206206
$ret = $this->exec($this->uri."/type/$key/accessible");
207207

@@ -219,13 +219,13 @@ public function getAccessibleProjectType(int|string $key) : ProjectType
219219
* get pagenated Project versions.
220220
*
221221
* @param int|string $projectIdOrKey
222-
* @param array $queryParam
222+
* @param array $queryParam
223223
*
224-
* @return Version[] array of version
225224
*@throws \JiraRestApi\JiraException
226225
*
226+
* @return Version[] array of version
227227
*/
228-
public function getVersionsPagenated(int|string $projectIdOrKey, array $queryParam = []) : array
228+
public function getVersionsPagenated(int|string $projectIdOrKey, array $queryParam = []): array
229229
{
230230
$default = [
231231
'startAt' => 0,
@@ -277,13 +277,13 @@ public function getVersions(string $projectIdOrKey): \ArrayObject
277277
* get specified's project version.
278278
*
279279
* @param int|string $projectIdOrKey
280-
* @param string $versionName
280+
* @param string $versionName
281281
*
282-
* @return Version version
283282
*@throws \JiraRestApi\JiraException
284283
*
284+
* @return Version version
285285
*/
286-
public function getVersion(int|string $projectIdOrKey, string $versionName) : Version
286+
public function getVersion(int|string $projectIdOrKey, string $versionName): Version
287287
{
288288
$ret = $this->exec($this->uri."/$projectIdOrKey/versions");
289289

@@ -309,12 +309,11 @@ public function getVersion(int|string $projectIdOrKey, string $versionName) : Ve
309309
*
310310
* @param Project $project
311311
*
312-
* @return Project project
313-
*
314312
* @throws JiraException
315313
*
314+
* @return Project project
316315
*/
317-
public function createProject(Project $project) : Project
316+
public function createProject(Project $project): Project
318317
{
319318
$data = json_encode($project);
320319

@@ -336,12 +335,12 @@ public function createProject(Project $project) : Project
336335
*
337336
* @param Project $project
338337
*
339-
* @return Project
340338
*@throws \JsonMapper_Exception
341-
*
342339
* @throws JiraException
340+
*
341+
* @return Project
343342
*/
344-
public function updateProject(Project $project, string|int $projectIdOrKey) : Project
343+
public function updateProject(Project $project, string|int $projectIdOrKey): Project
345344
{
346345
$data = json_encode($project);
347346

@@ -358,16 +357,16 @@ public function updateProject(Project $project, string|int $projectIdOrKey) : Pr
358357
/**
359358
* @param int|string $projectIdOrKey
360359
*
360+
*@throws JiraException
361+
*
361362
* @return string response status
362363
*
363364
* STATUS 401 Returned if the user is not logged in.
364365
* STATUS 204 - application/json Returned if the project is successfully deleted.
365366
* STATUS 403 - Returned if the currently authenticated user does not have permission to delete the project.
366367
* STATUS 404 - Returned if the project does not exist.
367-
*@throws JiraException
368-
*
369368
*/
370-
public function deleteProject(int|string $projectIdOrKey) : string
369+
public function deleteProject(int|string $projectIdOrKey): string
371370
{
372371
$ret = $this->exec($this->uri.'/'.$projectIdOrKey, null, 'DELETE');
373372

@@ -379,17 +378,17 @@ public function deleteProject(int|string $projectIdOrKey) : string
379378
*
380379
* @param int|string $projectIdOrKey
381380
*
381+
*@throws JiraException
382+
*
382383
* @return string response status
383384
*
384385
* STATUS 401 Returned if the user is not logged in.
385386
* STATUS 204 - application/json Returned if the project is successfully archived.
386387
* STATUS 403 - Returned if the currently authenticated user does not have permission to archive the project.
387388
* STATUS 404 - Returned if the project does not exist.
388389
* STATUS 405 - Method not allowed specified request HTTP method was received and recognized by the server, but is not supported by the target resource.
389-
*@throws JiraException
390-
*
391390
*/
392-
public function archiveProject(int|string $projectIdOrKey) : string
391+
public function archiveProject(int|string $projectIdOrKey): string
393392
{
394393
$ret = $this->exec($this->uri.'/'.$projectIdOrKey.'/archive', null, 'PUT');
395394

src/User/User.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace JiraRestApi\User;
44

5-
use JiraRestApi\ClassSerialize;
65
use JiraRestApi\Issue\Reporter;
76

87
/**

src/User/UserService.php

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace JiraRestApi\User;
44

5-
use JiraRestApi\Issue\Reporter;
6-
75
/**
86
* Class to perform all user related queries.
97
*
@@ -18,12 +16,12 @@ class UserService extends \JiraRestApi\JiraClient
1816
*
1917
* @param array|User $user
2018
*
21-
* @return User User class
2219
* @throws \JsonMapper_Exception
23-
*
2420
* @throws \JiraRestApi\JiraException
21+
*
22+
* @return User User class
2523
*/
26-
public function create(array|User $user) : User
24+
public function create(array|User $user): User
2725
{
2826
$data = json_encode($user);
2927

@@ -43,12 +41,12 @@ public function create(array|User $user) : User
4341
* @param array $paramArray Possible values for $paramArray 'username', 'key'.
4442
* "Either the 'username' or the 'key' query parameters need to be provided".
4543
*
46-
* @return User
4744
* @throws \JsonMapper_Exception
48-
*
4945
* @throws \JiraRestApi\JiraException
46+
*
47+
* @return User
5048
*/
51-
public function get(array $paramArray) : User
49+
public function get(array $paramArray): User
5250
{
5351
$queryParam = '?'.http_build_query($paramArray);
5452

@@ -67,12 +65,12 @@ public function get(array $paramArray) : User
6765
*
6866
* @param array $paramArray
6967
*
70-
* @return User[]
7168
*@throws \JsonMapper_Exception
72-
*
7369
* @throws \JiraRestApi\JiraException
70+
*
71+
* @return User[]
7472
*/
75-
public function findUsers(array $paramArray) : array
73+
public function findUsers(array $paramArray): array
7674
{
7775
$queryParam = '?'.http_build_query($paramArray);
7876

@@ -99,14 +97,14 @@ public function findUsers(array $paramArray) : array
9997
*
10098
* @param array $paramArray
10199
*
102-
* @return User[]
103-
*
104100
* @throws \JsonMapper_Exception
105-
*
106101
* @throws \JiraRestApi\JiraException
102+
*
103+
* @return User[]
104+
*
107105
* @see https://docs.atlassian.com/jira/REST/cloud/#api/2/user-findAssignableUsers
108106
*/
109-
public function findAssignableUsers(array $paramArray) : array
107+
public function findAssignableUsers(array $paramArray): array
110108
{
111109
$queryParam = '?'.http_build_query($paramArray);
112110

@@ -132,14 +130,14 @@ public function findAssignableUsers(array $paramArray) : array
132130
*
133131
* @param array $paramArray
134132
*
135-
* @return User[]
136-
*
137133
* @throws \JsonMapper_Exception
138-
*
139134
* @throws \JiraRestApi\JiraException
135+
*
136+
* @return User[]
137+
*
140138
* @see https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-user-search-query-get
141139
*/
142-
public function findUsersByQuery(array $paramArray) : array
140+
public function findUsersByQuery(array $paramArray): array
143141
{
144142
$queryParam = '?'.http_build_query($paramArray);
145143

@@ -169,7 +167,7 @@ public function findUsersByQuery(array $paramArray) : array
169167
*
170168
* @return string
171169
*/
172-
public function deleteUser(array $paramArray) : string
170+
public function deleteUser(array $paramArray): string
173171
{
174172
$queryParam = '?'.http_build_query($paramArray);
175173

@@ -185,7 +183,7 @@ public function deleteUser(array $paramArray) : string
185183
*
186184
* @return User
187185
*/
188-
public function getMyself() : User
186+
public function getMyself(): User
189187
{
190188
$ret = $this->exec('myself', null);
191189

@@ -200,12 +198,12 @@ public function getMyself() : User
200198
/**
201199
* @param array $paramArray
202200
*
203-
* @return User[]
204201
*@throws \JsonMapper_Exception
205-
*
206202
* @throws \JiraRestApi\JiraException
203+
*
204+
* @return User[]
207205
*/
208-
public function getUsers(array $paramArray) : array
206+
public function getUsers(array $paramArray): array
209207
{
210208
$queryParam = '?'.http_build_query($paramArray);
211209

@@ -226,15 +224,15 @@ public function getUsers(array $paramArray) : array
226224
/**
227225
* Function to update an existing user.
228226
*
229-
* @param array $paramArray
227+
* @param array $paramArray
230228
* @param array|User $user
231229
*
232-
* @return User
233230
* @throws \JsonMapper_Exception
234-
*
235231
* @throws \JiraRestApi\JiraException
232+
*
233+
* @return User
236234
*/
237-
public function update(array $paramArray, array|User $user) : User
235+
public function update(array $paramArray, array|User $user): User
238236
{
239237
$queryParam = '?'.http_build_query($paramArray);
240238

0 commit comments

Comments
 (0)