Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / fact / chart / PhabricatorChartInterval.php
blob9432d5be76bb072ca000608a2d78c42b3558f252
1 <?php
3 final class PhabricatorChartInterval
4 extends Phobject {
6 private $min;
7 private $max;
9 public function __construct($min, $max) {
10 $this->min = $min;
11 $this->max = $max;
14 public static function newFromIntervalList(array $intervals) {
15 $min = null;
16 $max = null;
17 foreach ($intervals as $interval) {
18 if ($interval === null) {
19 continue;
22 $interval_min = $interval->getMin();
23 if ($interval_min !== null) {
24 if ($min === null) {
25 $min = $interval_min;
26 } else {
27 $min = min($min, $interval_min);
31 $interval_max = $interval->getMax();
32 if ($interval_max !== null) {
33 if ($max === null) {
34 $max = $interval_max;
35 } else {
36 $max = max($max, $interval_max);
41 return new self($min, $max);
44 public function setMin($min) {
45 $this->min = $min;
46 return $this;
49 public function getMin() {
50 return $this->min;
53 public function setMax($max) {
54 $this->max = $max;
55 return $this;
58 public function getMax() {
59 return $this->max;