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

h4kuna / ares / 8853066536

22 Apr 2024 09:43AM UTC coverage: 89.487% (+0.4%) from 89.112%
8853066536

push

github

h4kuna
feat(VIES): add checker VAT in EU

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

1 existing line in 1 file now uncovered.

349 of 390 relevant lines covered (89.49%)

0.89 hits per line

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

83.33
/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
/**
14
 * properties become readonly
15
 */
16
class Ares
17
{
18
        public function __construct(
1✔
19
                public Core\ContentProvider $aresContentProvider,
20
                public DataBox\ContentProvider $dataBoxContentProvider,
21
                public Adis\ContentProvider $adisContentProvider,
22
                public Vies\ContentProvider $viesContentProvider,
23
        )
24
        {
25
        }
1✔
26

27

28
        /**
29
         * @deprecated use property
30
         */
31
        public function getAdis(): Adis\ContentProvider
32
        {
UNCOV
33
                return $this->adisContentProvider;
×
34
        }
35

36

37
        public function getAresClient(): Ares\Client
38
        {
NEW
39
                return $this->aresContentProvider->getClient();
×
40
        }
41

42

43
        /**
44
         * @template KeyName
45
         * @param array<KeyName, string|int> $identificationNumbers
46
         * @return Generator<(int&KeyName)|(KeyName&string), Data>
47
         */
48
        public function loadBasicMulti(array $identificationNumbers): Generator
1✔
49
        {
50
                return $this->aresContentProvider->loadByIdentificationNumbers($identificationNumbers);
1✔
51
        }
52

53

54
        /**
55
         * @throws IdentificationNumberNotFoundException
56
         */
57
        public function loadBasic(string $in): Data
1✔
58
        {
59
                return $this->aresContentProvider->load($in);
1✔
60
        }
61

62

63
        /**
64
         * @return array<stdClass>
65
         */
66
        public function loadDataBox(string $in): array
1✔
67
        {
68
                return $this->dataBoxContentProvider->load($in);
1✔
69
        }
70

71

72
        /**
73
         * @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}
74
         *
75
         * @throws ServerResponseException
76
         */
77
        public function checkVatVies(string|ViesEntity $viesEntityOrTin): object
1✔
78
        {
79
                return $this->viesContentProvider->checkVat($viesEntityOrTin);
1✔
80
        }
81

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