@@ -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 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | } |
26 | - public function setRestClient(){ |
|
26 | + public function setRestClient() { |
|
27 | 27 | $this->restClient = new JiraClient($this->configuration, $this->logger, $this->path); |
28 | 28 | $this->restClient->setAPIUri(''); |
29 | 29 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | static function getBoardFromJSON($json) { |
33 | 33 | $json_mapper = new \JsonMapper(); |
34 | 34 | $json_mapper->undefinedPropertyHandler = [new \JiraRestApi\JsonMapperHelper(), 'setUndefinedProperty']; |
35 | - return $json_mapper->map($json, new Board() ); |
|
35 | + return $json_mapper->map($json, new Board()); |
|
36 | 36 | } |
37 | 37 | static function getArrayOfBoardsFromJSON($boardList) { |
38 | 38 | $json_mapper = new \JsonMapper(); |
@@ -65,18 +65,18 @@ discard block |
||
65 | 65 | public function getAllBoards($paramArray = []) |
66 | 66 | { |
67 | 67 | $boardArray = array(); |
68 | - $boardArray = $this->loopOverResults($this->uri,$paramArray); |
|
68 | + $boardArray = $this->loopOverResults($this->uri, $paramArray); |
|
69 | 69 | return $this->getArrayOfBoardsFromJSON($boardArray); |
70 | 70 | } |
71 | 71 | |
72 | - public function getBoardWithSprintsList($boardId = null,$paramArray = []){ |
|
72 | + public function getBoardWithSprintsList($boardId = null, $paramArray = []) { |
|
73 | 73 | if (is_null($boardId)) { |
74 | 74 | $boardList = $this->getAllBoards(); |
75 | 75 | $boards = array(); |
76 | - foreach($boardList as $board) { |
|
76 | + foreach ($boardList as $board) { |
|
77 | 77 | if ($board->type == 'scrum') { |
78 | 78 | $boards[] = $this->getSprintInfoForBoard($board->id, $paramArray); |
79 | - }else { |
|
79 | + } else { |
|
80 | 80 | $boards[] = $board; |
81 | 81 | } |
82 | 82 | } |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | return $boards; |
87 | 87 | } |
88 | 88 | |
89 | - public function getSprintInfoForBoard($boardId,$paramArray) { |
|
89 | + public function getSprintInfoForBoard($boardId, $paramArray) { |
|
90 | 90 | $board = $this->getBoard($boardId); |
91 | - $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/',$paramArray); |
|
91 | + $sprintList = $this->loopOverResults($this->uri.'/'.$boardId.'/sprint/', $paramArray); |
|
92 | 92 | $sprintObjectsArray = array(); |
93 | 93 | foreach ($sprintList as $sprint) { |
94 | 94 | $sprintObjectsArray[$sprint->id] = SprintService::getSprintFromJSON($sprint); |
@@ -97,17 +97,17 @@ discard block |
||
97 | 97 | return $board; |
98 | 98 | } |
99 | 99 | |
100 | - public function loopOverResults($uri,$paramArray = []) { |
|
100 | + public function loopOverResults($uri, $paramArray = []) { |
|
101 | 101 | $resultsArray = array(); |
102 | 102 | $ret = $this->restClient->exec($uri.$this->restClient->toHttpQueryParameter($paramArray), null); |
103 | 103 | $results = json_decode($ret); |
104 | 104 | while (!$results->isLast) { |
105 | - $resultsArray = array_merge($resultsArray,$results->values); |
|
105 | + $resultsArray = array_merge($resultsArray, $results->values); |
|
106 | 106 | $paramArray['startAt'] = $results->startAt + $results->maxResults; |
107 | 107 | $ret = $this->restClient->exec($this->uri.$this->restClient->toHttpQueryParameter($paramArray), null); |
108 | 108 | $results = json_decode($ret); |
109 | 109 | } |
110 | - $resultsArray = array_merge($resultsArray,$results->values); |
|
110 | + $resultsArray = array_merge($resultsArray, $results->values); |
|
111 | 111 | return $resultsArray; |
112 | 112 | } |
113 | 113 |