Skip to content

Commit 99eb0f2

Browse files
authored
Merge pull request #304 from lesstif/analysis-0gbGnM
Apply fixes from StyleCI
2 parents c0afb15 + 146790c commit 99eb0f2

File tree

12 files changed

+150
-69
lines changed

12 files changed

+150
-69
lines changed

src/Attachment/AttachmentService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public function get($id, $outDir = null, $overwrite = false, $mode = 0777, $recu
3232
$this->log->info("Result=\n".$ret);
3333

3434
$attachment = $this->json_mapper->map(
35-
json_decode($ret), new Attachment()
35+
json_decode($ret),
36+
new Attachment()
3637
);
3738

3839
if ($outDir == null) {

src/Auth/AuthService.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public function getCurrentUser()
102102
$ret = $this->exec($this->uri);
103103

104104
$user = $this->json_mapper->map(
105-
json_decode($ret), new CurrentUser()
105+
json_decode($ret),
106+
new CurrentUser()
106107
);
107108

108109
return $user;
@@ -157,7 +158,8 @@ public function login($username = null, $password = null)
157158
]), 'POST');
158159

159160
$session = $this->json_mapper->map(
160-
json_decode($ret), new AuthSession()
161+
json_decode($ret),
162+
new AuthSession()
161163
);
162164

163165
return $session;

src/Field/FieldService.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ public function getAllFields($fieldType = Field::BOTH)
2020
$ret = $this->exec($this->uri, null);
2121

2222
$fields = $this->json_mapper->mapArray(
23-
json_decode($ret, false), new \ArrayObject(), '\JiraRestApi\Field\Field'
23+
json_decode($ret, false),
24+
new \ArrayObject(),
25+
'\JiraRestApi\Field\Field'
2426
);
2527

2628
// temp array
@@ -85,7 +87,8 @@ public function create(Field $field)
8587
$ret = $this->exec($this->uri, $data, 'POST');
8688

8789
$cf = $this->json_mapper->map(
88-
json_decode($ret), new Field()
90+
json_decode($ret),
91+
new Field()
8992
);
9093

9194
return $cf;

src/Field/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Schema
3232
*/
3333
public $custom;
3434

35-
/** custom filed id. Ex: 10201
35+
/** custom filed id. Ex: 10201.
3636
* @var string
3737
*/
3838
public $customId;

src/Group/GroupService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public function get($paramArray)
2929
$this->log->info("Result=\n".$ret);
3030

3131
return $this->json_mapper->map(
32-
json_decode($ret), new Group()
32+
json_decode($ret),
33+
new Group()
3334
);
3435
}
3536

@@ -77,7 +78,8 @@ public function createGroup($group)
7778
$this->log->info("Result=\n".$ret);
7879

7980
$group = $this->json_mapper->map(
80-
json_decode($ret), new Group()
81+
json_decode($ret),
82+
new Group()
8183
);
8284

8385
return $group;
@@ -103,7 +105,8 @@ public function addUserToGroup($groupName, $userName)
103105
$this->log->info("Result=\n".$ret);
104106

105107
$group = $this->json_mapper->map(
106-
json_decode($ret), new Group()
108+
json_decode($ret),
109+
new Group()
107110
);
108111

109112
return $group;

src/Issue/IssueService.php

Lines changed: 61 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class IssueService extends \JiraRestApi\JiraClient
1818
public function getIssueFromJSON($json)
1919
{
2020
$issue = $this->json_mapper->map(
21-
$json, new Issue()
21+
$json,
22+
new Issue()
2223
);
2324

2425
return $issue;
@@ -50,7 +51,8 @@ public function get($issueIdOrKey, $paramArray = [], $issueObject = null)
5051
$this->log->info("Result=\n".$ret);
5152

5253
return $issue = $this->json_mapper->map(
53-
json_decode($ret), $issueObject
54+
json_decode($ret),
55+
$issueObject
5456
);
5557
}
5658

@@ -162,16 +164,21 @@ public function addAttachments($issueIdOrKey, $filePathArray)
162164
$ret = json_decode($ret);
163165
if (is_array($ret)) {
164166
$tmpArr = $this->json_mapper->mapArray(
165-
$ret, new \ArrayObject(), '\JiraRestApi\Issue\Attachment'
167+
$ret,
168+
new \ArrayObject(),
169+
'\JiraRestApi\Issue\Attachment'
166170
);
167171

168172
foreach ($tmpArr as $t) {
169173
array_push($attachArr, $t);
170174
}
171175
} elseif (is_object($ret)) {
172-
array_push($attachArr, $this->json_mapper->map(
173-
$ret, new Attachment()
174-
)
176+
array_push(
177+
$attachArr,
178+
$this->json_mapper->map(
179+
$ret,
180+
new Attachment()
181+
)
175182
);
176183
}
177184
}
@@ -235,7 +242,8 @@ public function addComment($issueIdOrKey, $comment)
235242

236243
$this->log->debug('add comment result='.var_export($ret, true));
237244
$comment = $this->json_mapper->map(
238-
json_decode($ret), new Comment()
245+
json_decode($ret),
246+
new Comment()
239247
);
240248

241249
return $comment;
@@ -267,7 +275,8 @@ public function updateComment($issueIdOrKey, $id, $comment)
267275

268276
$this->log->debug('update comment result='.var_export($ret, true));
269277
$comment = $this->json_mapper->map(
270-
json_decode($ret), new Comment()
278+
json_decode($ret),
279+
new Comment()
271280
);
272281

273282
return $comment;
@@ -292,8 +301,9 @@ public function getComment($issueIdOrKey, $id)
292301

293302
$this->log->debug('get comment result='.var_export($ret, true));
294303
$comment = $this->json_mapper->map(
295-
json_decode($ret), new Comment()
296-
);
304+
json_decode($ret),
305+
new Comment()
306+
);
297307

298308
return $comment;
299309
}
@@ -316,8 +326,9 @@ public function getComments($issueIdOrKey)
316326

317327
$this->log->debug('get comments result='.var_export($ret, true));
318328
$comment = $this->json_mapper->map(
319-
json_decode($ret), new Comment()
320-
);
329+
json_decode($ret),
330+
new Comment()
331+
);
321332

322333
return $comment;
323334
}
@@ -439,7 +450,9 @@ public function getTransition($issueIdOrKey, $paramArray = [])
439450
$data = json_encode(json_decode($ret)->transitions);
440451

441452
$transitions = $this->json_mapper->mapArray(
442-
json_decode($data), new \ArrayObject(), '\JiraRestApi\Issue\Transition'
453+
json_decode($data),
454+
new \ArrayObject(),
455+
'\JiraRestApi\Issue\Transition'
443456
);
444457

445458
return $transitions;
@@ -536,11 +549,13 @@ public function search($jql, $startAt = 0, $maxResults = 15, $fields = [], $expa
536549
$result = null;
537550
if ($this->isRestApiV3()) {
538551
$result = $this->json_mapper->map(
539-
$json, new IssueSearchResultV3()
552+
$json,
553+
new IssueSearchResultV3()
540554
);
541555
} else {
542556
$result = $this->json_mapper->map(
543-
$json, new IssueSearchResult()
557+
$json,
558+
new IssueSearchResult()
544559
);
545560
}
546561

@@ -563,7 +578,8 @@ public function getTimeTracking($issueIdOrKey)
563578
$this->log->debug("getTimeTracking res=$ret\n");
564579

565580
$issue = $this->json_mapper->map(
566-
json_decode($ret), new Issue()
581+
json_decode($ret),
582+
new Issue()
567583
);
568584

569585
return $issue->fields->timeTracking;
@@ -614,7 +630,8 @@ public function getWorklog($issueIdOrKey)
614630
$ret = $this->exec($this->uri."/$issueIdOrKey/worklog");
615631
$this->log->debug("getWorklog res=$ret\n");
616632
$worklog = $this->json_mapper->map(
617-
json_decode($ret), new PaginatedWorklog()
633+
json_decode($ret),
634+
new PaginatedWorklog()
618635
);
619636

620637
return $worklog;
@@ -636,7 +653,8 @@ public function getWorklogById($issueIdOrKey, $workLogId)
636653
$ret = $this->exec($this->uri."/$issueIdOrKey/worklog/$workLogId");
637654
$this->log->debug("getWorklogById res=$ret\n");
638655
$worklog = $this->json_mapper->map(
639-
json_decode($ret), new Worklog()
656+
json_decode($ret),
657+
new Worklog()
640658
);
641659

642660
return $worklog;
@@ -664,7 +682,8 @@ public function addWorklog($issueIdOrKey, $worklog)
664682
$ret = $this->exec($url, $data, $type);
665683

666684
$ret_worklog = $this->json_mapper->map(
667-
json_decode($ret), new Worklog()
685+
json_decode($ret),
686+
new Worklog()
668687
);
669688

670689
return $ret_worklog;
@@ -693,7 +712,8 @@ public function editWorklog($issueIdOrKey, $worklog, $worklogId)
693712
$ret = $this->exec($url, $data, $type);
694713

695714
$ret_worklog = $this->json_mapper->map(
696-
json_decode($ret), new Worklog()
715+
json_decode($ret),
716+
new Worklog()
697717
);
698718

699719
return $ret_worklog;
@@ -718,7 +738,7 @@ public function deleteWorklog($issueIdOrKey, $worklogId)
718738

719739
$ret = $this->exec($url, null, $type);
720740

721-
return (bool)$ret;
741+
return (bool) $ret;
722742
}
723743

724744
/**
@@ -733,7 +753,9 @@ public function getAllPriorities()
733753
$ret = $this->exec('priority', null);
734754

735755
$priorities = $this->json_mapper->mapArray(
736-
json_decode($ret, false), new \ArrayObject(), '\JiraRestApi\Issue\Priority'
756+
json_decode($ret, false),
757+
new \ArrayObject(),
758+
'\JiraRestApi\Issue\Priority'
737759
);
738760

739761
return $priorities;
@@ -757,7 +779,8 @@ public function getPriority($priorityId)
757779
$this->log->info('Result='.$ret);
758780

759781
$prio = $this->json_mapper->map(
760-
json_decode($ret), new Priority()
782+
json_decode($ret),
783+
new Priority()
761784
);
762785

763786
return $prio;
@@ -781,7 +804,8 @@ public function getCustomFields($priorityId)
781804
$this->log->info('Result='.$ret);
782805

783806
$prio = $this->json_mapper->map(
784-
json_decode($ret), new Priority()
807+
json_decode($ret),
808+
new Priority()
785809
);
786810

787811
return $prio;
@@ -805,7 +829,9 @@ public function getWatchers($issueIdOrKey)
805829
$ret = $this->exec($url, null);
806830

807831
$watchers = $this->json_mapper->mapArray(
808-
json_decode($ret, false)->watchers, new \ArrayObject(), '\JiraRestApi\Issue\Reporter'
832+
json_decode($ret, false)->watchers,
833+
new \ArrayObject(),
834+
'\JiraRestApi\Issue\Reporter'
809835
);
810836

811837
return $watchers;
@@ -987,7 +1013,9 @@ public function getRemoteIssueLink($issueIdOrKey)
9871013
$ret = $this->exec($full_uri, null);
9881014

9891015
$rils = $this->json_mapper->mapArray(
990-
json_decode($ret, false), new \ArrayObject(), RemoteIssueLink::class
1016+
json_decode($ret, false),
1017+
new \ArrayObject(),
1018+
RemoteIssueLink::class
9911019
);
9921020

9931021
return $rils;
@@ -1013,7 +1041,8 @@ public function createOrUpdateRemoteIssueLink($issueIdOrKey, RemoteIssueLink $ri
10131041
$ret = $this->exec($full_uri, $data, 'POST');
10141042

10151043
$res = $this->json_mapper->map(
1016-
json_decode($ret), new RemoteIssueLink()
1044+
json_decode($ret),
1045+
new RemoteIssueLink()
10171046
);
10181047

10191048
return $res;
@@ -1067,7 +1096,9 @@ public function getAllIssueSecuritySchemes()
10671096
$schemes = json_decode(json_encode($data['issueSecuritySchemes']), false);
10681097

10691098
$res = $this->json_mapper->mapArray(
1070-
$schemes, new \ArrayObject(), '\JiraRestApi\Issue\SecurityScheme'
1099+
$schemes,
1100+
new \ArrayObject(),
1101+
'\JiraRestApi\Issue\SecurityScheme'
10711102
);
10721103

10731104
return $res;
@@ -1090,7 +1121,8 @@ public function getIssueSecuritySchemes($securityId)
10901121
$ret = $this->exec($url);
10911122

10921123
$res = $this->json_mapper->map(
1093-
json_decode($ret), new SecurityScheme()
1124+
json_decode($ret),
1125+
new SecurityScheme()
10941126
);
10951127

10961128
return $res;

src/Issue/JqlQuery.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,10 @@ public function addAnyExpression($expression)
539539
*/
540540
public function addExpression($field, $operator, $value, $logicLinkKeyword = self::KEYWORD_AND)
541541
{
542-
$this->joinExpression(self::quoteField($field)." $operator ".self::quote($value),
543-
$logicLinkKeyword);
542+
$this->joinExpression(
543+
self::quoteField($field)." $operator ".self::quote($value),
544+
$logicLinkKeyword
545+
);
544546

545547
return $this;
546548
}
@@ -563,8 +565,10 @@ public function addInExpression($field, $values, $logicLinkKeyword = self::KEYWO
563565
foreach ($values as $value) {
564566
$valuesQuoted[] = self::quote($value);
565567
}
566-
$this->joinExpression(self::quoteField($field).' in ('.implode(', ', $valuesQuoted).')',
567-
$logicLinkKeyword);
568+
$this->joinExpression(
569+
self::quoteField($field).' in ('.implode(', ', $valuesQuoted).')',
570+
$logicLinkKeyword
571+
);
568572

569573
return $this;
570574
}
@@ -587,8 +591,10 @@ public function addNotInExpression($field, $values, $logicLinkKeyword = self::KE
587591
foreach ($values as $value) {
588592
$valuesQuoted[] = self::quote($value);
589593
}
590-
$this->joinExpression(self::quoteField($field).' not in ('.implode(', ', $valuesQuoted).')',
591-
$logicLinkKeyword);
594+
$this->joinExpression(
595+
self::quoteField($field).' not in ('.implode(', ', $valuesQuoted).')',
596+
$logicLinkKeyword
597+
);
592598

593599
return $this;
594600
}

src/IssueLink/IssueLinkService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public function getIssueLinkTypes()
4141
$data = json_encode(json_decode($ret)->issueLinkTypes);
4242

4343
$linkTypes = $this->json_mapper->mapArray(
44-
json_decode($data, false), new \ArrayObject(), '\JiraRestApi\IssueLink\IssueLinkType'
44+
json_decode($data, false),
45+
new \ArrayObject(),
46+
'\JiraRestApi\IssueLink\IssueLinkType'
4547
);
4648

4749
return $linkTypes;

0 commit comments

Comments
 (0)