Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function passes($attribute, $vatId): bool |
||
15 | { |
||
16 | // can't validate without country code |
||
17 | if (!$this->countryCode) { |
||
18 | return true; |
||
19 | } |
||
20 | |||
21 | if ($this->countryCode !== 'CH') { |
||
22 | $vatId = preg_replace('/[^0-9A-Za-z]/', '', $vatId); |
||
23 | } |
||
24 | |||
25 | return (new Validator)->isValid($this->countryCode . $vatId); |
||
26 | } |
||
33 |