@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | class Sprint implements \JsonSerializable |
13 | 13 | { |
14 | - use ClassSerialize; |
|
14 | + use ClassSerialize; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * return only if Project query by key(not id). |
@@ -76,26 +76,26 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | public function getGoal(){ |
79 | - return str_replace(array("\n\r", "\n", "\r"), '', $this->goal); |
|
79 | + return str_replace(array("\n\r", "\n", "\r"), '', $this->goal); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | public function getStartDate($format = 'Y-m-d H:i:s') { |
83 | - if (!is_null($this->startDate)) { |
|
83 | + if (!is_null($this->startDate)) { |
|
84 | 84 | $date = new \DateTime($this->startDate); |
85 | 85 | return date_format($date, $format); |
86 | - } |
|
87 | - return null; |
|
88 | - // return date_format($this->startDate, $format); |
|
86 | + } |
|
87 | + return null; |
|
88 | + // return date_format($this->startDate, $format); |
|
89 | 89 | |
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 | - } |
|
97 | - return null; |
|
98 | - // return date_format($this->endDate, $format); |
|
96 | + } |
|
97 | + return null; |
|
98 | + // return date_format($this->endDate, $format); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | } |
@@ -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 | } |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | $this->path = $path; |
27 | 27 | $this->restClient = $jiraClient; |
28 | 28 | if (!$this->restClient) { |
29 | - $this->setRestClient(); |
|
29 | + $this->setRestClient(); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | } |
33 | 33 | |
34 | 34 | public function setRestClient(){ |
35 | - $this->restClient = new JiraClient($this->configuration, $this->logger, $this->path); |
|
36 | - $this->restClient->setAPIUri(''); |
|
35 | + $this->restClient = new JiraClient($this->configuration, $this->logger, $this->path); |
|
36 | + $this->restClient->setAPIUri(''); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -61,26 +61,26 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | public function getVelocityForSprint($sprintID){ |
64 | - try { |
|
64 | + try { |
|
65 | 65 | $sprint = $this->getSprint($sprintID); |
66 | 66 | if (!is_null($sprint->originBoardId)){ |
67 | - $ret = $this->restClient->exec('/rest/greenhopper/1.0/rapid/charts/velocity.json?rapidViewId='.$sprint->originBoardId.'&sprintId='.$sprint->id); |
|
68 | - $velocityObject = json_decode($ret); |
|
69 | - $velocityStats = $velocityObject->{'velocityStatEntries'}; |
|
70 | - if (property_exists($velocityStats,$sprint->id)) { |
|
67 | + $ret = $this->restClient->exec('/rest/greenhopper/1.0/rapid/charts/velocity.json?rapidViewId='.$sprint->originBoardId.'&sprintId='.$sprint->id); |
|
68 | + $velocityObject = json_decode($ret); |
|
69 | + $velocityStats = $velocityObject->{'velocityStatEntries'}; |
|
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 | - } else { |
|
73 | + } else { |
|
74 | 74 | $sprint->estimatedVelocity = null; |
75 | 75 | $sprint->completedVelocity = null; |
76 | - } |
|
76 | + } |
|
77 | 77 | } |
78 | 78 | return $sprint; |
79 | - } |
|
80 | - catch (JiraException $e) { |
|
79 | + } |
|
80 | + catch (JiraException $e) { |
|
81 | 81 | print("Error Occured! " . $e->getMessage()); |
82 | 82 | return null; |
83 | - } |
|
83 | + } |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | } |
@@ -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 | } |