VehicleInspectionDateChecker   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkDates() 0 7 2
1
<?php
2
3
namespace Madkom\RegistryApplication\Domain\CarManagement\VehicleInspection;
4
5
/**
6
 * Class VehicleInspectionDateChecker.
7
 */
8
class VehicleInspectionDateChecker
9
{
10
    /**
11
     * @param \Madkom\RegistryApplication\Domain\CarManagement\VehicleInspection\VehicleInspection $newVehicleInspection
12
     *
13
     * @return bool
14
     */
15
    public function checkDates(VehicleInspection $newVehicleInspection)
16
    {
17
        $interval = $newVehicleInspection->getUpcomingInspection()->diff($newVehicleInspection->getLastInspection());
18
        $interval = $interval->format('%R%a');
19
20
        return ((int) $interval >= 0) ?: false;
21
    }
22
}
23