@@ -18,7 +18,8 @@ class IssueService extends \JiraRestApi\JiraClient
18
18
public function getIssueFromJSON ($ json )
19
19
{
20
20
$ issue = $ this ->json_mapper ->map (
21
- $ json , new Issue ()
21
+ $ json ,
22
+ new Issue ()
22
23
);
23
24
24
25
return $ issue ;
@@ -50,7 +51,8 @@ public function get($issueIdOrKey, $paramArray = [], $issueObject = null)
50
51
$ this ->log ->info ("Result= \n" .$ ret );
51
52
52
53
return $ issue = $ this ->json_mapper ->map (
53
- json_decode ($ ret ), $ issueObject
54
+ json_decode ($ ret ),
55
+ $ issueObject
54
56
);
55
57
}
56
58
@@ -162,16 +164,21 @@ public function addAttachments($issueIdOrKey, $filePathArray)
162
164
$ ret = json_decode ($ ret );
163
165
if (is_array ($ ret )) {
164
166
$ tmpArr = $ this ->json_mapper ->mapArray (
165
- $ ret , new \ArrayObject (), '\JiraRestApi\Issue\Attachment '
167
+ $ ret ,
168
+ new \ArrayObject (),
169
+ '\JiraRestApi\Issue\Attachment '
166
170
);
167
171
168
172
foreach ($ tmpArr as $ t ) {
169
173
array_push ($ attachArr , $ t );
170
174
}
171
175
} 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
+ )
175
182
);
176
183
}
177
184
}
@@ -235,7 +242,8 @@ public function addComment($issueIdOrKey, $comment)
235
242
236
243
$ this ->log ->debug ('add comment result= ' .var_export ($ ret , true ));
237
244
$ comment = $ this ->json_mapper ->map (
238
- json_decode ($ ret ), new Comment ()
245
+ json_decode ($ ret ),
246
+ new Comment ()
239
247
);
240
248
241
249
return $ comment ;
@@ -267,7 +275,8 @@ public function updateComment($issueIdOrKey, $id, $comment)
267
275
268
276
$ this ->log ->debug ('update comment result= ' .var_export ($ ret , true ));
269
277
$ comment = $ this ->json_mapper ->map (
270
- json_decode ($ ret ), new Comment ()
278
+ json_decode ($ ret ),
279
+ new Comment ()
271
280
);
272
281
273
282
return $ comment ;
@@ -292,8 +301,9 @@ public function getComment($issueIdOrKey, $id)
292
301
293
302
$ this ->log ->debug ('get comment result= ' .var_export ($ ret , true ));
294
303
$ comment = $ this ->json_mapper ->map (
295
- json_decode ($ ret ), new Comment ()
296
- );
304
+ json_decode ($ ret ),
305
+ new Comment ()
306
+ );
297
307
298
308
return $ comment ;
299
309
}
@@ -316,8 +326,9 @@ public function getComments($issueIdOrKey)
316
326
317
327
$ this ->log ->debug ('get comments result= ' .var_export ($ ret , true ));
318
328
$ comment = $ this ->json_mapper ->map (
319
- json_decode ($ ret ), new Comment ()
320
- );
329
+ json_decode ($ ret ),
330
+ new Comment ()
331
+ );
321
332
322
333
return $ comment ;
323
334
}
@@ -439,7 +450,9 @@ public function getTransition($issueIdOrKey, $paramArray = [])
439
450
$ data = json_encode (json_decode ($ ret )->transitions );
440
451
441
452
$ 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 '
443
456
);
444
457
445
458
return $ transitions ;
@@ -536,11 +549,13 @@ public function search($jql, $startAt = 0, $maxResults = 15, $fields = [], $expa
536
549
$ result = null ;
537
550
if ($ this ->isRestApiV3 ()) {
538
551
$ result = $ this ->json_mapper ->map (
539
- $ json , new IssueSearchResultV3 ()
552
+ $ json ,
553
+ new IssueSearchResultV3 ()
540
554
);
541
555
} else {
542
556
$ result = $ this ->json_mapper ->map (
543
- $ json , new IssueSearchResult ()
557
+ $ json ,
558
+ new IssueSearchResult ()
544
559
);
545
560
}
546
561
@@ -563,7 +578,8 @@ public function getTimeTracking($issueIdOrKey)
563
578
$ this ->log ->debug ("getTimeTracking res= $ ret \n" );
564
579
565
580
$ issue = $ this ->json_mapper ->map (
566
- json_decode ($ ret ), new Issue ()
581
+ json_decode ($ ret ),
582
+ new Issue ()
567
583
);
568
584
569
585
return $ issue ->fields ->timeTracking ;
@@ -614,7 +630,8 @@ public function getWorklog($issueIdOrKey)
614
630
$ ret = $ this ->exec ($ this ->uri ."/ $ issueIdOrKey/worklog " );
615
631
$ this ->log ->debug ("getWorklog res= $ ret \n" );
616
632
$ worklog = $ this ->json_mapper ->map (
617
- json_decode ($ ret ), new PaginatedWorklog ()
633
+ json_decode ($ ret ),
634
+ new PaginatedWorklog ()
618
635
);
619
636
620
637
return $ worklog ;
@@ -636,7 +653,8 @@ public function getWorklogById($issueIdOrKey, $workLogId)
636
653
$ ret = $ this ->exec ($ this ->uri ."/ $ issueIdOrKey/worklog/ $ workLogId " );
637
654
$ this ->log ->debug ("getWorklogById res= $ ret \n" );
638
655
$ worklog = $ this ->json_mapper ->map (
639
- json_decode ($ ret ), new Worklog ()
656
+ json_decode ($ ret ),
657
+ new Worklog ()
640
658
);
641
659
642
660
return $ worklog ;
@@ -664,7 +682,8 @@ public function addWorklog($issueIdOrKey, $worklog)
664
682
$ ret = $ this ->exec ($ url , $ data , $ type );
665
683
666
684
$ ret_worklog = $ this ->json_mapper ->map (
667
- json_decode ($ ret ), new Worklog ()
685
+ json_decode ($ ret ),
686
+ new Worklog ()
668
687
);
669
688
670
689
return $ ret_worklog ;
@@ -693,7 +712,8 @@ public function editWorklog($issueIdOrKey, $worklog, $worklogId)
693
712
$ ret = $ this ->exec ($ url , $ data , $ type );
694
713
695
714
$ ret_worklog = $ this ->json_mapper ->map (
696
- json_decode ($ ret ), new Worklog ()
715
+ json_decode ($ ret ),
716
+ new Worklog ()
697
717
);
698
718
699
719
return $ ret_worklog ;
@@ -718,7 +738,7 @@ public function deleteWorklog($issueIdOrKey, $worklogId)
718
738
719
739
$ ret = $ this ->exec ($ url , null , $ type );
720
740
721
- return (bool )$ ret ;
741
+ return (bool ) $ ret ;
722
742
}
723
743
724
744
/**
@@ -733,7 +753,9 @@ public function getAllPriorities()
733
753
$ ret = $ this ->exec ('priority ' , null );
734
754
735
755
$ 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 '
737
759
);
738
760
739
761
return $ priorities ;
@@ -757,7 +779,8 @@ public function getPriority($priorityId)
757
779
$ this ->log ->info ('Result= ' .$ ret );
758
780
759
781
$ prio = $ this ->json_mapper ->map (
760
- json_decode ($ ret ), new Priority ()
782
+ json_decode ($ ret ),
783
+ new Priority ()
761
784
);
762
785
763
786
return $ prio ;
@@ -781,7 +804,8 @@ public function getCustomFields($priorityId)
781
804
$ this ->log ->info ('Result= ' .$ ret );
782
805
783
806
$ prio = $ this ->json_mapper ->map (
784
- json_decode ($ ret ), new Priority ()
807
+ json_decode ($ ret ),
808
+ new Priority ()
785
809
);
786
810
787
811
return $ prio ;
@@ -805,7 +829,9 @@ public function getWatchers($issueIdOrKey)
805
829
$ ret = $ this ->exec ($ url , null );
806
830
807
831
$ 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 '
809
835
);
810
836
811
837
return $ watchers ;
@@ -987,7 +1013,9 @@ public function getRemoteIssueLink($issueIdOrKey)
987
1013
$ ret = $ this ->exec ($ full_uri , null );
988
1014
989
1015
$ 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
991
1019
);
992
1020
993
1021
return $ rils ;
@@ -1013,7 +1041,8 @@ public function createOrUpdateRemoteIssueLink($issueIdOrKey, RemoteIssueLink $ri
1013
1041
$ ret = $ this ->exec ($ full_uri , $ data , 'POST ' );
1014
1042
1015
1043
$ res = $ this ->json_mapper ->map (
1016
- json_decode ($ ret ), new RemoteIssueLink ()
1044
+ json_decode ($ ret ),
1045
+ new RemoteIssueLink ()
1017
1046
);
1018
1047
1019
1048
return $ res ;
@@ -1067,7 +1096,9 @@ public function getAllIssueSecuritySchemes()
1067
1096
$ schemes = json_decode (json_encode ($ data ['issueSecuritySchemes ' ]), false );
1068
1097
1069
1098
$ res = $ this ->json_mapper ->mapArray (
1070
- $ schemes , new \ArrayObject (), '\JiraRestApi\Issue\SecurityScheme '
1099
+ $ schemes ,
1100
+ new \ArrayObject (),
1101
+ '\JiraRestApi\Issue\SecurityScheme '
1071
1102
);
1072
1103
1073
1104
return $ res ;
@@ -1090,7 +1121,8 @@ public function getIssueSecuritySchemes($securityId)
1090
1121
$ ret = $ this ->exec ($ url );
1091
1122
1092
1123
$ res = $ this ->json_mapper ->map (
1093
- json_decode ($ ret ), new SecurityScheme ()
1124
+ json_decode ($ ret ),
1125
+ new SecurityScheme ()
1094
1126
);
1095
1127
1096
1128
return $ res ;
0 commit comments