| File: MonthCalc.php Lines 8 to 27 | 
 | 
8 |  */ | 
 | 
9 | class MonthCalc | 
 | 
10 | { | 
 | 
11 |     /** | 
 | 
12 |      * | 
 | 
13 |      * @param \DateTime $dt | 
 | 
14 |      * @param int $offset | 
 | 
15 |      * @return \DateTime | 
 | 
16 |      */ | 
 |  |     public function calc(\DateTime $dt, $offset) { | 
 | 
18 |         if($offset === null) { | 
 | 
19 |             $offset = 1; | 
 | 
20 |         } | 
 | 
21 |  | 
 | 
22 |         $result = clone $dt; | 
 | 
23 |  | 
 | 
24 |         $day = $dt->format('j'); | 
 | 
25 |         if($offset >= 0) { | 
 | 
26 |             $dayOfNextMonth = $result->add(new \DateInterval('P'.$offset.'M'))->format('j'); | 
 | 
27 |         } else { | 
|   |