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

h4kuna / ares / 8781737527

22 Apr 2024 09:27AM UTC coverage: 89.744% (+0.6%) from 89.112%
8781737527

push

github

h4kuna
feat(VIES): add checker VAT in EU

41 of 45 new or added lines in 8 files covered. (91.11%)

350 of 390 relevant lines covered (89.74%)

0.9 hits per line

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

91.67
/src/Ares.php
1
<?php declare(strict_types=1);
2

3
namespace h4kuna\Ares;
4

5
use Generator;
6
use h4kuna\Ares\Ares\Core;
7
use h4kuna\Ares\Ares\Core\Data;
8
use h4kuna\Ares\Exceptions\IdentificationNumberNotFoundException;
9
use h4kuna\Ares\Exceptions\ServerResponseException;
10
use h4kuna\Ares\Vies\ViesEntity;
11
use stdClass;
12

13
class Ares
14
{
15
        public function __construct(
1✔
16
                public Core\ContentProvider $aresContentProvider,
17
                public DataBox\ContentProvider $dataBoxContentProvider,
18
                public Adis\ContentProvider $adisContentProvider,
19
                public Vies\ContentProvider $viesContentProvider,
20
        )
21
        {
22
        }
1✔
23

24

25
        public function getAdis(): Adis\ContentProvider
26
        {
27
                return $this->adisContentProvider;
1✔
28
        }
29

30

31
        public function getAresClient(): Ares\Client
32
        {
NEW
33
                return $this->aresContentProvider->getClient();
×
34
        }
35

36

37
        /**
38
         * @template KeyName
39
         * @param array<KeyName, string|int> $identificationNumbers
40
         * @return Generator<(int&KeyName)|(KeyName&string), Data>
41
         */
42
        public function loadBasicMulti(array $identificationNumbers): Generator
1✔
43
        {
44
                return $this->aresContentProvider->loadByIdentificationNumbers($identificationNumbers);
1✔
45
        }
46

47

48
        /**
49
         * @throws IdentificationNumberNotFoundException
50
         */
51
        public function loadBasic(string $in): Data
1✔
52
        {
53
                return $this->aresContentProvider->load($in);
1✔
54
        }
55

56

57
        /**
58
         * @return array<stdClass>
59
         */
60
        public function loadDataBox(string $in): array
1✔
61
        {
62
                return $this->dataBoxContentProvider->load($in);
1✔
63
        }
64

65

66
        /**
67
         * @return object{countryCode: string, vatNumber: string, requestDate: string, valid: bool, requestIdentifier: string, name: string, address: string, traderName: string, traderStreet: string, traderPostalCode: string, traderCity: string, traderCompanyType: string, traderNameMatch: string, traderStreetMatch: string, traderPostalCodeMatch: string, traderCityMatch: string, traderCompanyTypeMatch: string}
68
         *
69
         * @throws ServerResponseException
70
         */
71
        public function checkVatVies(string|ViesEntity $vatNumber)
1✔
72
        {
73
                return $this->viesContentProvider->checkVat($vatNumber);
1✔
74
        }
75

76
}
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

© 2025 Coveralls, Inc