Leap::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
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