SantaCruzValidator::validate()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3.0416

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 3
nop 1
dl 0
loc 11
ccs 5
cts 6
cp 0.8333
crap 3.0416
rs 10
c 0
b 0
f 0
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