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

Birthdate::isSame()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
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