GRAlgorithm   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 6 2
A isFollowLength() 0 3 1
1
<?php
2
3
namespace LeKoala\Tin\Algo;
4
5
use LeKoala\Tin\Util\StringUtil;
6
7
/**
8
 * Greece
9
 */
10
class GRAlgorithm extends TINAlgorithm
11
{
12
    const LENGTH = 9;
13
14
    public function validate(string $tin)
15
    {
16
        if (!$this->isFollowLength($tin)) {
17
            return StatusCode::INVALID_LENGTH;
18
        }
19
        return StatusCode::VALID;
20
    }
21
22
    public function isFollowLength(string $tin)
23
    {
24
        return StringUtil::isFollowLength($tin, self::LENGTH);
25
    }
26
}
27