Completed
Push — master ( 461ffe...a27db3 )
by João Felipe Magro
12:47
created

DateUtil   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 10 3
1
<?php
2
3
namespace Ipag\Classes\Util;
4
5
final class DateUtil
6
{
7
    public function isValid($date)
8
    {
9
        if (preg_match("/([0-9]{2})\/([0-9]{2})\/([0-9]{4})/", $date, $matches)) {
10
            if (checkdate($matches[2], $matches[1], $matches[3])) {
11
                return true;
12
            }
13
        }
14
15
        return false;
16
    }
17
}
18