Code Duplication    Length = 3-3 lines in 2 locations

src/DateExtension.php 2 locations

@@ 153-155 (lines=3) @@
150
            return null;
151
        }
152
        
153
        if (!$date instanceof \DateTime) {
154
            $date = is_int($date) ? \DateTime::createFromFormat('U', $date) : new \DateTime((string)$date);
155
        }
156
        
157
        $formatter = $this->getDateFormatter($dateFormat, $timeFormat, $calendar);
158
        
@@ 311-313 (lines=3) @@
308
            return null;
309
        }
310
        
311
        if (!$date instanceof \DateTime) {
312
            $date = is_int($date) ? \DateTime::createFromFormat('U', $date) : new \DateTime((string)$date);
313
        }
314
        
315
        return $date->diff(new \DateTime())->format('%y');
316
    }