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

h4kuna / ares / 15317728387

28 May 2025 11:06AM UTC coverage: 84.434% (-0.09%) from 84.524%
15317728387

push

github

h4kuna
feat(exceptions): rename namespace from plural exceptions to single expcetion

4 of 13 new or added lines in 8 files covered. (30.77%)

358 of 424 relevant lines covered (84.43%)

0.84 hits per line

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

93.75
/src/Adis/ContentProvider.php
1
<?php declare(strict_types=1);
2

3
namespace h4kuna\Ares\Adis;
4

5
use Generator;
6
use h4kuna\Ares\Adis\StatusBusinessSubjects\StatusBusinessSubjectsTransformer;
7
use h4kuna\Ares\Adis\StatusBusinessSubjects\Subject;
8
use h4kuna\Ares\Ares\Helper;
9
use h4kuna\Ares\Exception\LogicException;
10
use h4kuna\Ares\Tool\Batch;
11

12
final class ContentProvider
13
{
14
        public function __construct(private Client $client, private StatusBusinessSubjectsTransformer $stdClassTransformer)
1✔
15
        {
16
        }
1✔
17

18

19
        public function statusBusinessSubject(string $tin): Subject
1✔
20
        {
21
                foreach ($this->statusBusinessSubjects([$tin => $tin]) as $subject) {
1✔
22
                        return $subject;
1✔
23
                }
24

NEW
25
                throw new LogicException('ADIS must return anything.');
×
26
        }
27

28

29
        /**
30
         * @param array<string, string> $tin
31
         * @return Generator<string, Subject>
32
         */
33
        public function statusBusinessSubjects(array $tin): Generator
1✔
34
        {
35
                $duplicity = Batch::checkDuplicities($tin, static fn (string $tin) => Helper::normalizeTIN($tin));
1✔
36
                $chunks = Batch::chunk($duplicity, 100);
1✔
37

38
                foreach ($chunks as $chunk) {
1✔
39
                        $responseData = $this->client->statusBusinessSubjects($chunk);
1✔
40

41
                        foreach ($responseData as $item) {
1✔
42
                                $subject = $this->stdClassTransformer->transform($item);
1✔
43
                                foreach ($duplicity[$subject->tin] as $name) {
1✔
44
                                        yield $name => $subject;
1✔
45
                                }
46
                        }
47
                }
48
        }
1✔
49

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