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

CreditCard::mounth()   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 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Validate;
4
5
class CreditCard extends \Faker\Provider\Payment implements \Validate\Contracts\Validate
6
{
7
8
    public static function toDatabase($creditCardNumber)
9
    {
10
        return strtoupper(preg_replace('/[^0-9]/', '', $creditCardNumber));
11
    }
12
13
    public static function toUser($creditCardNumber)
14
    {
15
        return strtoupper(preg_replace('/[^0-9]/', '', $creditCardNumber));
16
    }
17
18
    public static function validate($creditCardNumber)
19
    {
20
        return true;
21
    }
22
23
    public static function mounth($year)
24
    {
25
        return Date::validateMonth($year);
26
    }
27
28
    public static function year($year)
29
    {
30
        return Date::yearToDatabase($year);
31
    }
32
33
    public static function isSame(string $to, string $from)
34
    {
35
        return (self::toDatabase($to)===self::toDatabase($from));
36
    }
37
38
}
39