• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

h4kuna / ares / 20451232047

05 Dec 2025 08:01AM UTC coverage: 84.821% (-4.7%) from 89.497%
20451232047

push

github

h4kuna
Update ARES API 1.3.0

17 of 18 new or added lines in 1 file covered. (94.44%)

21 existing lines in 5 files now uncovered.

380 of 448 relevant lines covered (84.82%)

0.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/src/Vies/ContentProvider.php
1
<?php declare(strict_types=1);
2

3
namespace h4kuna\Ares\Vies;
4

5
use h4kuna\Ares\Exception\LogicException;
6
use h4kuna\Ares\Exception\ServerResponseException;
7
use Nette\Utils\Strings;
8
use stdClass;
9

10
/**
11
 * @phpstan-import-type ViesResponse from Client
12
 */
13
final class ContentProvider
14
{
15
        public function __construct(private Client $client)
1✔
16
        {
17
        }
1✔
18

19

20
        /**
21
         * @param string|ViesEntity $vatNumber
22
         * @return ViesResponse
23
         *
24
         * @throws ServerResponseException
25
         */
26
        public function checkVat(string|ViesEntity $vatNumber): object
27
        {
UNCOV
28
                if (is_string($vatNumber)) {
×
UNCOV
29
                        $match = Strings::match($vatNumber, '/(?<country>[A-Z]{2})/');
×
UNCOV
30
                        if (isset($match['country']) === false) {
×
31
                                throw new LogicException('Use class ViesEntity instead of string.');
×
32
                        }
33

UNCOV
34
                        $viesEntity = new ViesEntity(substr($vatNumber, 2), $match['country']);
×
35
                } else {
UNCOV
36
                        $viesEntity = $vatNumber;
×
37
                }
38

UNCOV
39
                return $this->client->checkVatNumber($viesEntity);
×
40
        }
41

42

43
        /**
44
         * @throws ServerResponseException
45
         */
46
        public function status(): stdClass
47
        {
UNCOV
48
                return $this->client->status();
×
49
        }
50
}
51

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc