Completed
Pull Request — master (#193)
by
unknown
01:45
created
src/Version/VersionService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         $this->log->addInfo('Result='.$ret);
62 62
 
63 63
         $json = json_decode($ret);
64
-        $results = array_map(function ($elem) {
64
+        $results = array_map(function($elem) {
65 65
             return $this->json_mapper->map($elem, new ProjectType());
66 66
         }, $json);
67 67
 
Please login to merge, or discard this patch.
src/Project/ProjectService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $ret = $this->exec("/user/assignable/search?project=$projectIdOrKey", null);
70 70
         $json = json_decode($ret);
71
-        $results = array_map(function ($elem) {
71
+        $results = array_map(function($elem) {
72 72
             return $this->json_mapper->map($elem, new Reporter());
73 73
         }, $json);
74 74
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $ret = $this->exec($this->uri."/$projectIdOrKey/statuses", null);
88 88
         $json = json_decode($ret);
89
-        $results = array_map(function ($elem) {
89
+        $results = array_map(function($elem) {
90 90
             return $this->json_mapper->map($elem, new IssueType());
91 91
         }, $json);
92 92
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $this->log->addInfo('Result='.$ret);
106 106
 
107 107
         $json = json_decode($ret);
108
-        $results = array_map(function ($elem) {
108
+        $results = array_map(function($elem) {
109 109
             return $this->json_mapper->map($elem, new ProjectType());
110 110
         }, $json);
111 111
 
Please login to merge, or discard this patch.
src/Project/Project.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
 
93 93
     public function jsonSerialize()
94 94
     {
95
-        return array_filter(get_object_vars($this), function ($var) {
95
+        return array_filter(get_object_vars($this), function($var) {
96 96
             return !is_null($var);
97 97
         });
98 98
     }
Please login to merge, or discard this patch.
src/Dumper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
     public static function dd($x)
27 27
     {
28
-        array_map(function ($x) {
28
+        array_map(function($x) {
29 29
             (new Dumper())->dump($x);
30 30
         }, func_get_args());
31 31
         die(1);
Please login to merge, or discard this patch.
src/Issue/IssueField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
 
141 141
     public function jsonSerialize()
142 142
     {
143
-        $vars = array_filter(get_object_vars($this), function ($var) {
143
+        $vars = array_filter(get_object_vars($this), function($var) {
144 144
             return !is_null($var);
145 145
         });
146 146
 
Please login to merge, or discard this patch.
src/Issue/IssueService.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
         $this->log->addDebug('add comment result='.var_export($ret, true));
225 225
         $comment = $this->json_mapper->map(
226
-           json_decode($ret), new Comment()
226
+            json_decode($ret), new Comment()
227 227
         );
228 228
 
229 229
         return $comment;
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         $data = json_encode(json_decode($ret)->transitions);
368 368
 
369 369
         $transitions = $this->json_mapper->mapArray(
370
-           json_decode($data), new \ArrayObject(), '\JiraRestApi\Issue\Transition'
370
+            json_decode($data), new \ArrayObject(), '\JiraRestApi\Issue\Transition'
371 371
         );
372 372
 
373 373
         return $transitions;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         $this->log->addDebug("getTimeTracking res=$ret\n");
485 485
 
486 486
         $issue = $this->json_mapper->map(
487
-             json_decode($ret), new Issue()
487
+                json_decode($ret), new Issue()
488 488
         );
489 489
 
490 490
         return $issue->fields->timeTracking;
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
         $ret = $this->exec($url, $data, $type);
586 586
 
587 587
         $ret_worklog = $this->json_mapper->map(
588
-           json_decode($ret), new Worklog()
588
+            json_decode($ret), new Worklog()
589 589
         );
590 590
 
591 591
         return $ret_worklog;
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
         $ret = $this->exec('priority', null);
633 633
 
634 634
         $priorities = $this->json_mapper->mapArray(
635
-             json_decode($ret, false), new \ArrayObject(), '\JiraRestApi\Issue\Priority'
635
+                json_decode($ret, false), new \ArrayObject(), '\JiraRestApi\Issue\Priority'
636 636
         );
637 637
 
638 638
         return $priorities;
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
         $this->log->addInfo('Result='.$ret);
657 657
 
658 658
         $prio = $this->json_mapper->map(
659
-             json_decode($ret), new Priority()
659
+                json_decode($ret), new Priority()
660 660
         );
661 661
 
662 662
         return $prio;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -783,7 +783,7 @@
 block discarded – undo
783 783
         $metas = json_decode($ret, true);
784 784
 
785 785
         // extract only custom field(startWith customefield_XXXXX)
786
-        $cfs = array_filter($metas['fields'], function ($key) {
786
+        $cfs = array_filter($metas['fields'], function($key) {
787 787
             $pos = strpos($key, 'customfield');
788 788
 
789 789
             return $pos !== false;
Please login to merge, or discard this patch.
src/JiraRestApiServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function register()
29 29
     {
30
-        $this->app->bind(ConfigurationInterface::class, function () {
30
+        $this->app->bind(ConfigurationInterface::class, function() {
31 31
             return new DotEnvConfiguration(base_path());
32 32
         });
33 33
     }
Please login to merge, or discard this patch.
src/Field/FieldService.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         $ret = $this->exec($this->uri, null);
21 21
 
22 22
         $fields = $this->json_mapper->mapArray(
23
-             json_decode($ret, false), new \ArrayObject(), '\JiraRestApi\Field\Field'
23
+                json_decode($ret, false), new \ArrayObject(), '\JiraRestApi\Field\Field'
24 24
         );
25 25
 
26 26
         // temp array
Please login to merge, or discard this patch.
src/Board/BoardService.php 3 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,29 +21,29 @@  discard block
 block discarded – undo
21 21
         $this->path = $path;
22 22
         $this->restClient = $jiraClient;
23 23
         if (!$this->restClient) {
24
-          $this->setRestClient();
24
+            $this->setRestClient();
25 25
         }
26 26
 
27 27
     }
28 28
     public function setRestClient(){
29
-      $this->restClient = new JiraClient($this->configuration, $this->logger, $this->path);
30
-      $this->restClient->setAPIUri('');
29
+        $this->restClient = new JiraClient($this->configuration, $this->logger, $this->path);
30
+        $this->restClient->setAPIUri('');
31 31
 
32 32
     }
33 33
 
34 34
 
35 35
     static function getBoardFromJSON($json) {
36
-      $json_mapper = new \JsonMapper();
37
-      $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty'];
38
-      return $json_mapper->map($json, new Board() );
36
+        $json_mapper = new \JsonMapper();
37
+        $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty'];
38
+        return $json_mapper->map($json, new Board() );
39 39
     }
40 40
     static function getArrayOfBoardsFromJSON($boardList) {
41
-      $json_mapper = new \JsonMapper();
42
-      $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty'];
43
-      return $json_mapper->mapArray($boardList,
41
+        $json_mapper = new \JsonMapper();
42
+        $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty'];
43
+        return $json_mapper->mapArray($boardList,
44 44
                                     new \ArrayObject(),
45 45
                                     '\JiraRestApi\Board\Board'
46
-                                  );
46
+                                    );
47 47
 
48 48
     }
49 49
 
@@ -74,46 +74,46 @@  discard block
 block discarded – undo
74 74
     }
75 75
 
76 76
     public function getBoardWithSprintsList($boardId = null,$paramArray = []){
77
-      if (is_null($boardId)) {
77
+        if (is_null($boardId)) {
78 78
         $boardList = $this->getAllBoards();
79 79
         $boards = array();
80 80
         foreach($boardList as $board) {
81
-          if ($board->type == 'scrum') {
81
+            if ($board->type == 'scrum') {
82 82
             $boards[] = $this->getSprintInfoForBoard($board->id, $paramArray);
83
-          }else {
83
+            }else {
84 84
             $boards[] = $board;
85
-          }
85
+            }
86 86
         }
87
-      } else {
87
+        } else {
88 88
         $boards[] = $this->getSprintInfoForBoard($boardId, $paramArray);
89
-      }
90
-      return $boards;
89
+        }
90
+        return $boards;
91 91
     }
92 92
 
93 93
     public function getSprintInfoForBoard($boardId,$paramArray) {
94
-      $board = $this->getBoard($boardId);
95
-      $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/',$paramArray);
96
-      $sprintObjectsArray = array();
97
-      foreach ($sprintList as $sprint) {
94
+        $board = $this->getBoard($boardId);
95
+        $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/',$paramArray);
96
+        $sprintObjectsArray = array();
97
+        foreach ($sprintList as $sprint) {
98 98
         $sprintObjectsArray[$sprint->id] = SprintService::getSprintFromJSON($sprint);
99
-      }
100
-      $board->sprintList = $sprintObjectsArray;
101
-      return $board;
99
+        }
100
+        $board->sprintList = $sprintObjectsArray;
101
+        return $board;
102 102
 
103 103
     }
104 104
 
105 105
     public function loopOverResults($uri,$paramArray = []) {
106
-      $resultsArray = array();
107
-      $ret = $this->restClient->exec($uri.$this->restClient->toHttpQueryParameter($paramArray), null);
108
-      $results = json_decode($ret);
109
-      while (!$results->isLast) {
106
+        $resultsArray = array();
107
+        $ret = $this->restClient->exec($uri.$this->restClient->toHttpQueryParameter($paramArray), null);
108
+        $results = json_decode($ret);
109
+        while (!$results->isLast) {
110 110
         $resultsArray = array_merge($resultsArray,$results->values);
111 111
         $paramArray['startAt'] = $results->startAt + $results->maxResults;
112 112
         $ret = $this->restClient->exec($this->uri.$this->restClient->toHttpQueryParameter($paramArray), null);
113 113
         $results = json_decode($ret);
114
-      }
115
-      $resultsArray = array_merge($resultsArray,$results->values);
116
-      return $resultsArray;
114
+        }
115
+        $resultsArray = array_merge($resultsArray,$results->values);
116
+        return $resultsArray;
117 117
     }
118 118
 
119 119
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         }
26 26
 
27 27
     }
28
-    public function setRestClient(){
28
+    public function setRestClient() {
29 29
       $this->restClient = new JiraClient($this->configuration, $this->logger, $this->path);
30 30
       $this->restClient->setAPIUri('');
31 31
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     static function getBoardFromJSON($json) {
36 36
       $json_mapper = new \JsonMapper();
37 37
       $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty'];
38
-      return $json_mapper->map($json, new Board() );
38
+      return $json_mapper->map($json, new Board());
39 39
     }
40 40
     static function getArrayOfBoardsFromJSON($boardList) {
41 41
       $json_mapper = new \JsonMapper();
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
     public function getAllBoards($paramArray = [])
70 70
     {
71 71
         $boardArray = array();
72
-        $boardArray = $this->loopOverResults($this->uri,$paramArray);
72
+        $boardArray = $this->loopOverResults($this->uri, $paramArray);
73 73
         return $this->getArrayOfBoardsFromJSON($boardArray);
74 74
     }
75 75
 
76
-    public function getBoardWithSprintsList($boardId = null,$paramArray = []){
76
+    public function getBoardWithSprintsList($boardId = null, $paramArray = []) {
77 77
       if (is_null($boardId)) {
78 78
         $boardList = $this->getAllBoards();
79 79
         $boards = array();
80
-        foreach($boardList as $board) {
80
+        foreach ($boardList as $board) {
81 81
           if ($board->type == 'scrum') {
82 82
             $boards[] = $this->getSprintInfoForBoard($board->id, $paramArray);
83
-          }else {
83
+          } else {
84 84
             $boards[] = $board;
85 85
           }
86 86
         }
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
       return $boards;
91 91
     }
92 92
 
93
-    public function getSprintInfoForBoard($boardId,$paramArray) {
93
+    public function getSprintInfoForBoard($boardId, $paramArray) {
94 94
       $board = $this->getBoard($boardId);
95
-      $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/',$paramArray);
95
+      $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/', $paramArray);
96 96
       $sprintObjectsArray = array();
97 97
       foreach ($sprintList as $sprint) {
98 98
         $sprintObjectsArray[$sprint->id] = SprintService::getSprintFromJSON($sprint);
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 
103 103
     }
104 104
 
105
-    public function loopOverResults($uri,$paramArray = []) {
105
+    public function loopOverResults($uri, $paramArray = []) {
106 106
       $resultsArray = array();
107 107
       $ret = $this->restClient->exec($uri.$this->restClient->toHttpQueryParameter($paramArray), null);
108 108
       $results = json_decode($ret);
109 109
       while (!$results->isLast) {
110
-        $resultsArray = array_merge($resultsArray,$results->values);
110
+        $resultsArray = array_merge($resultsArray, $results->values);
111 111
         $paramArray['startAt'] = $results->startAt + $results->maxResults;
112 112
         $ret = $this->restClient->exec($this->uri.$this->restClient->toHttpQueryParameter($paramArray), null);
113 113
         $results = json_decode($ret);
114 114
       }
115
-      $resultsArray = array_merge($resultsArray,$results->values);
115
+      $resultsArray = array_merge($resultsArray, $results->values);
116 116
       return $resultsArray;
117 117
     }
118 118
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
         foreach($boardList as $board) {
81 81
           if ($board->type == 'scrum') {
82 82
             $boards[] = $this->getSprintInfoForBoard($board->id, $paramArray);
83
-          }else {
83
+          } else {
84 84
             $boards[] = $board;
85 85
           }
86 86
         }
Please login to merge, or discard this patch.