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.

Event   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 25.93 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 7
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
/**
4
 * @file
5
 * Class Event
6
 */
7
8
namespace Roomify\Bat\Event;
9
10
use Roomify\Bat\Event\AbstractEvent;
11
use Roomify\Bat\Unit\UnitInterface;
12
13
class Event extends AbstractEvent {
14
15
  // Redeclaring constants used in AbstractEvent because of no clean way to
16
  // have constants inherited;
17
  const BAT_DAY = 'bat_day';
18
  const BAT_HOUR = 'bat_hour';
19
  const BAT_MINUTE = 'bat_minute';
20
  const BAT_HOURLY = 'bat_hourly';
21
  const BAT_DAILY = 'bat_daily';
22
23
  /**
24
   * Event constructor.
25
   *
26
   * @param \DateTime $start_date
27
   * @param \DateTime $end_date
28
   * @param $unit
29
   * @param $value
30
   */
31 View Code Duplication
  public function __construct(\DateTime $start_date, \DateTime $end_date, UnitInterface $unit, $value = 0) {
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...
32
    $this->unit_id = $unit->getUnitId();
33
    $this->unit = $unit;
34
    $this->start_date = clone($start_date);
35
    $this->end_date = clone($end_date);
36
    $this->value = $value;
37
  }
38
39
}
40