File: MonthCalc.php Lines 8 to 27
8 */
9class MonthCalc
10{
11    /**
12     *
13     * @param \DateTime $dt
14     * @param int $offset
15     * @return \DateTime
16     */
Type Class Description
pmd ShortVariable Avoid variables with short names like $dt. Configured minimum length is 3.
17
Type Class Description
pmd ShortVariable Avoid variables with short names like $dt. Configured minimum length is 3.
    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 {