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.

AbstractValuator::setEndDate()   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 1
1
<?php
2
3
/**
4
 * @file
5
 * Class AbstractValuator
6
 */
7
8
namespace Roomify\Bat\Valuator;
9
10
use Roomify\Bat\Store\Store;
11
use Roomify\Bat\Valuator\ValuatorInterface;
12
use Roomify\Bat\Unit\UnitInterface;
13
14
abstract class AbstractValuator implements ValuatorInterface {
15
16
  /**
17
   * The start date of the period over which we should reason about value
18
   *
19
   * @var /DateTime
20
   */
21
  protected $start_date;
22
23
24
  /**
25
   * The end date of the period over which we should reason about value
26
   * @var /DateTime
27
   */
28
  protected $end_date;
29
30
31
  /**
32
   * The unit involved
33
   * @var
34
   */
35
  protected $unit;
36
37
  /**
38
   * The store from which to retrieve event value data
39
   *
40
   * @var Store
41
   */
42
  protected $store;
43
44
  /**
45
   * AbstractValuator constructor.
46
   * @param \DateTime $start_date
47
   * @param \DateTime $end_date
48
   * @param \Roomify\Bat\Unit\UnitInterface $unit
49
   */
50 View Code Duplication
  public function __construct(\DateTime $start_date, \DateTime $end_date, UnitInterface $unit, Store $store) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
51
    $this->start_date = clone($start_date);
52
    $this->end_date = clone($end_date);
53
    $this->unit = $unit;
54
    $this->store = $store;
55
  }
56
57
  /**
58
   * @param \DateTime $start_date
59
   */
60
  public function setStartDate(\DateTime $start_date) {
61
    $this->start_date = clone($start_date);
62
  }
63
64
  /**
65
   * @return \DateTime
66
   */
67
  public function getStartDate() {
68
    return $this->start_date;
69
  }
70
71
  /**
72
   * @param \DateTime $end_date
73
   */
74
  public function setEndDate(\DateTime $end_date) {
75
    $this->end_date = $end_date;
76
  }
77
78
  /**
79
   * @return \DateTime
80
   */
81
  public function getEndDate() {
82
    return $this->end_date;
83
  }
84
85
  /**
86
   * @param \Roomify\Bat\Unit\UnitInterface $unit
87
   */
88
  public function setUnit(UnitInterface $unit) {
89
    $this->unit = $unit;
90
  }
91
92
  /**
93
   * @return \Roomify\Bat\Unit\UnitInterface
94
   */
95
  public function getUnit() {
96
    return $this->unit;
97
  }
98
99
  /**
100
   * @param $events
101
   * @return mixed
102
   */
103
  abstract public function determineValue();
104
105
}
106