@@ -25,7 +25,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | return $this->name; |
76 | 76 | } |
77 | 77 | |
78 | - public function getGoal(){ |
|
78 | + public function getGoal() { |
|
79 | 79 | return str_replace(array("\n\r", "\n", "\r"), '', $this->goal); |
80 | 80 | } |
81 | 81 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | public function getEndDate($format = 'Y-m-d H:i:s') { |
93 | - if (!is_null($this->endDate)){ |
|
93 | + if (!is_null($this->endDate)) { |
|
94 | 94 | $date = new \DateTime($this->endDate); |
95 | 95 | return date_format($date, $format); |
96 | 96 | } |
@@ -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 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function jsonSerialize() |
27 | 27 | { |
28 | - return array_filter(get_object_vars($this), function ($var) { |
|
28 | + return array_filter(get_object_vars($this), function($var) { |
|
29 | 29 | return !is_null($var); |
30 | 30 | }); |
31 | 31 | } |