GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

AbstractConstraint::getStartDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * @file
5
 * Class AbstractConstraint
6
 */
7
8
namespace Roomify\Bat\Constraint;
9
10
use Roomify\Bat\Calendar\CalendarResponse;
11
use Roomify\Bat\Constraint\ConstraintInterface;
12
13
/**
14
 * A constraint acts as a filter that can be applied to a Calendar Response to
15
 * further reduce the set of matching units based on criteria beyond their
16
 * specific state over the time range the Calendar was queried.
17
 */
18
abstract class AbstractConstraint implements ConstraintInterface {
19
20
  /**
21
   * @var \DateTime
22
   */
23
  protected $start_date;
24
25
  /**
26
   * @var \DateTime
27
   */
28
  protected $end_date;
29
30
  /**
31
   * @var array
32
   */
33
  protected $affected_units;
34
35
  /**
36
   * @var CalendarResponse
37
   */
38
  protected $calendar_response;
39
40
  /**
41
   * @var array
42
   */
43
  protected $units = array();
44
45
  /**
46
   * {@inheritdoc}
47
   */
48
  public function setStartDate(\DateTime $start_date) {
49
    $this->start_date = clone($start_date);
50
  }
51
52
  /**
53
   * {@inheritdoc}
54
   */
55
  public function getStartDate() {
56
    return clone($this->start_date);
57
  }
58
59
  /**
60
   * {@inheritdoc}
61
   */
62
  public function setEndDate(\DateTime $end_date) {
63
    $this->end_date = clone($end_date);
64
  }
65
66
  /**
67
   * {@inheritdoc}
68
   */
69
  public function getEndDate() {
70
    return clone($this->end_date);
71
  }
72
73
  /**
74
   * {@inheritdoc}
75
   */
76
  public function getAffectedUnits() {
77
    return $this->affected_units;
78
  }
79
80
  /**
81
   * {@inheritdoc}
82
   */
83
  public function getUnits() {
84
    $keyed_units = array();
85
    foreach ($this->units as $unit) {
86
      $keyed_units[$unit->getUnitId()] = $unit;
87
    }
88
89
    return $keyed_units;
90
  }
91
92
  /**
93
   * {@inheritdoc}
94
   */
95
  public function applyConstraint(CalendarResponse &$calendar_response) {
96
    $this->calendar_response = $calendar_response;
97
  }
98
99
}
100