| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function validate(string $tin) |
||
| 16 | { |
||
| 17 | $str = StringUtil::clearString($tin); |
||
| 18 | if (!StringUtil::isFollowLength($str, 11)) { |
||
| 19 | return StatusCode::INVALID_LENGTH; |
||
| 20 | } |
||
| 21 | if (!StringUtil::isFollowPattern($str, self::PATTERN)) { |
||
| 22 | return StatusCode::INVALID_PATTERN; |
||
| 23 | } |
||
| 24 | if (!$this->isFollowRules($str)) { |
||
| 25 | return StatusCode::INVALID_SYNTAX; |
||
| 26 | } |
||
| 27 | return StatusCode::VALID; |
||
| 28 | } |
||
| 45 |