SantaCruzValidator::isRetirement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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