From a7d797b4d384aecc4b485de20c271358f98df65e Mon Sep 17 00:00:00 2001
From: Alvaro Soliverez <alvaro.soliverez@collabora.com>
Date: Tue, 29 Nov 2016 23:47:43 +0000
Subject: [PATCH] Use Maniphest own functions instead of hardcoded status

This patch changes to check for all open status, and for all closed status, not just "open" and "resolved".
It is kind of controversial in that it now returns all tasks that are closed, and not just the ones set to "resolved". This includes wontfix, invalid, or whatever other statuses have been set the closed: true property.
Differential Revision: https://phabricator.collabora.co.uk/D975
---
 src/util/SprintPoints.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/SprintPoints.php b/src/util/SprintPoints.php
index 03bd351..d3afa89 100644
--- a/src/util/SprintPoints.php
+++ b/src/util/SprintPoints.php
@@ -79,10 +79,10 @@ private $viewer;
 
     $points = $this->getTaskPoints($task);
 
-    if ($status == 'open') {
+    if (ManiphestTaskStatus::isOpenStatus($status)) {
       $this->task_open_status_sum =
           $this->setTaskOpenStatusSum($this->task_open_status_sum, $points);
-    } else if ($status == 'resolved') {
+    } else if (ManiphestTaskStatus::isClosedStatus($status)) {
       $this->task_closed_status_sum =
           $this->setTaskClosedStatusSum($this->task_closed_status_sum, $points);
     }
-- 
GitLab