Test Failed
Push — master ( f47101...348e9e )
by Ricardo
02:03
created

Birthdate::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Validate;
4
5
use Validate\Traits\FakeNameTrait;
6
7
class Birthdate extends Date implements \Validate\Contracts\Validate
8
{
9
    use FakeNameTrait;
10
11
    public static function toDatabase($birthdate)
12
    {
13
        return parent::toDatabase($birthdate);
14
    }
15
16
    public static function validate($birthdate)
17
    {   
18
        if (!parent::validate($birthdate)){
19
            return false;
20
        }
21
22
        return true;
23
    }
24
25
    public static function isSame(string $to, string $from)
26
    {
27
        return (self::toDatabase($to)===self::toDatabase($from));
28
    }
29
30
}
31