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

h4kuna / ares / 13277831837

03 Feb 2025 06:36AM UTC coverage: 84.524% (-5.3%) from 89.838%
13277831837

push

github

h4kuna
fix(tests)

355 of 420 relevant lines covered (84.52%)

0.85 hits per line

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

72.73
/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\AdisResponseException;
9
use h4kuna\Ares\Exceptions\IdentificationNumberNotFoundException;
10
use h4kuna\Ares\Exceptions\ServerResponseException;
11
use h4kuna\Ares\Vies\ViesEntity;
12
use stdClass;
13

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

28

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

37

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

43

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

54

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

64

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

73

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

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