@@ -19,7 +19,7 @@ |
||
19 | 19 | $this->path = $path; |
20 | 20 | $this->restClient = $jiraClient; |
21 | 21 | if (!$this->restClient) { |
22 | - $this->setRestClient(); |
|
22 | + $this->setRestClient(); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $json_mapper = new \JsonMapper(); |
36 | 36 | $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty']; |
37 | 37 | return $json_mapper->map($json, |
38 | - new Board() ); |
|
38 | + new Board()); |
|
39 | 39 | } |
40 | 40 | public static function getArrayOfBoardsFromJSON($boardList) |
41 | 41 | { |
@@ -69,11 +69,11 @@ discard block |
||
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 | { |
78 | 78 | if (is_null($boardId)) { |
79 | 79 | $boardList = $this->getAllBoards(); |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | return $boards; |
92 | 92 | } |
93 | 93 | |
94 | - public function getSprintInfoForBoard($boardId,$paramArray) |
|
94 | + public function getSprintInfoForBoard($boardId, $paramArray) |
|
95 | 95 | { |
96 | 96 | $board = $this->getBoard($boardId); |
97 | - $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/',$paramArray); |
|
97 | + $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/', $paramArray); |
|
98 | 98 | $sprintObjectsArray = array(); |
99 | 99 | foreach ($sprintList as $sprint) { |
100 | 100 | $sprintObjectsArray[$sprint->id] = SprintService::getSprintFromJSON($sprint); |
@@ -103,17 +103,17 @@ discard block |
||
103 | 103 | return $board; |
104 | 104 | } |
105 | 105 | |
106 | - public function loopOverResults($uri,$paramArray = []) |
|
106 | + public function loopOverResults($uri, $paramArray = []) |
|
107 | 107 | { |
108 | 108 | $resultsArray = array(); |
109 | 109 | $ret = $this->restClient->exec($uri.$this->restClient->toHttpQueryParameter($paramArray), null); |
110 | 110 | $results = json_decode($ret); |
111 | 111 | while (!$results->isLast) { |
112 | - $resultsArray = array_merge($resultsArray,$results->values); |
|
112 | + $resultsArray = array_merge($resultsArray, $results->values); |
|
113 | 113 | $paramArray['startAt'] = $results->startAt + $results->maxResults; |
114 | 114 | $ret = $this->restClient->exec($this->uri.$this->restClient->toHttpQueryParameter($paramArray), null); |
115 | 115 | $results = json_decode($ret); |
116 | 116 | } |
117 | - return array_merge($resultsArray,$results->values); |
|
117 | + return array_merge($resultsArray, $results->values); |
|
118 | 118 | } |
119 | 119 | } |
@@ -92,7 +92,7 @@ |
||
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 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | } |
33 | 33 | |
34 | - public function setRestClient(){ |
|
34 | + public function setRestClient() { |
|
35 | 35 | $this->restClient = new JiraClient($this->configuration, $this->logger, $this->path); |
36 | 36 | $this->restClient->setAPIUri(''); |
37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $json_mapper = new \JsonMapper(); |
43 | 43 | $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty']; |
44 | - return $json_mapper->map($json, new Sprint() ); |
|
44 | + return $json_mapper->map($json, new Sprint()); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | return $this->getSprintFromJSON(json_decode($ret)); |
61 | 61 | } |
62 | 62 | |
63 | - public function getVelocityForSprint($sprintID){ |
|
63 | + public function getVelocityForSprint($sprintID) { |
|
64 | 64 | try { |
65 | 65 | $sprint = $this->getSprint($sprintID); |
66 | - if (!is_null($sprint->originBoardId)){ |
|
66 | + if (!is_null($sprint->originBoardId)) { |
|
67 | 67 | $ret = $this->restClient->exec('/rest/greenhopper/1.0/rapid/charts/velocity.json?rapidViewId='.$sprint->originBoardId.'&sprintId='.$sprint->id); |
68 | 68 | $velocityObject = json_decode($ret); |
69 | 69 | $velocityStats = $velocityObject->{'velocityStatEntries'}; |
70 | - if (property_exists($velocityStats,$sprint->id)) { |
|
70 | + if (property_exists($velocityStats, $sprint->id)) { |
|
71 | 71 | $sprint->estimatedVelocity = $velocityStats->{$sprint->id}->{'estimated'}->value; |
72 | 72 | $sprint->completedVelocity = $velocityStats->{$sprint->id}->{'completed'}->value; |
73 | 73 | } else { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | return $sprint; |
79 | 79 | } |
80 | 80 | catch (JiraException $e) { |
81 | - print("Error Occured! " . $e->getMessage()); |
|
81 | + print("Error Occured! ".$e->getMessage()); |
|
82 | 82 | return null; |
83 | 83 | } |
84 | 84 | } |
@@ -76,8 +76,7 @@ |
||
76 | 76 | } |
77 | 77 | } |
78 | 78 | return $sprint; |
79 | - } |
|
80 | - catch (JiraException $e) { |
|
79 | + } catch (JiraException $e) { |
|
81 | 80 | print("Error Occured! " . $e->getMessage()); |
82 | 81 | return null; |
83 | 82 | } |