Leap   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A get() 0 8 1
1
<?php namespace OpenCafe\Tools;
2
3
/**
4
 * @since Aug, 21 2015
5
 */
6
class Leap
7
{
8
9
    /**
10
   * @param integer store year value
11
   */
12
    protected $year;
13
14
    /**
15
   * @param string store type of year value
16
   */
17
    protected $type;
18
19
    /**
20
   * @param boolean store result of leap functions
21
   */
22
    protected $result;
23
24
25
    /**
26
   * @param $year integer
27
   * @since Aug, 21 2015
28
   */
29
    public function __construct($year, $type = 'gregorian')
30
    {
31
32
         $this->year = $year;
33
34
         $this->type = $type;
35
36
         return $this;
0 ignored issues
show
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
37
38
    }
39
40
41
    /**
42
   * return the year is leap or not
43
   *
44
   * @since  Aug, 21 2015
45
   * @return boolean
46
   */
47
    public function get()
48
    {
49
50
        $this->result = include 'CalendarSettings/' . ucfirst($this->type) . '.php';
51
52
        return $this->result['leap_year']($this->year);
53
54
    }
55
}
56