SantaCruzValidator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 28
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 11 3
A isRetirement() 0 3 1
1
<?php
2
3
namespace MidasSoft\DominicanBankParser\Validators;
4
5
use MidasSoft\DominicanBankParser\Interfaces\ValidatorInterface;
6
7
class SantaCruzValidator implements ValidatorInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12 2
    public static function validate(array $deposit)
13
    {
14 2
        if (count($deposit) != 4) {
15 2
            return false;
16
        }
17
18 2
        if (self::isRetirement($deposit[1])) {
19
            return false;
20
        }
21
22 2
        return true;
23
    }
24
25
    /**
26
     * Checks if the deposit is a retirement.
27
     *
28
     * @param string $description
29
     *
30
     * @return bool
31
     */
32 2
    private static function isRetirement($description)
33
    {
34 2
        return $description == 'Retiro Por Cajas';
35
    }
36
}
37