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

h4kuna / ares / 15350555273

30 May 2025 03:48PM UTC coverage: 87.919%. First build
15350555273

push

github

h4kuna
feat(composer): update phpstan

14 of 36 new or added lines in 13 files covered. (38.89%)

393 of 447 relevant lines covered (87.92%)

0.88 hits per line

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

81.82
/src/DataBox/Client.php
1
<?php declare(strict_types=1);
2

3
namespace h4kuna\Ares\DataBox;
4

5
use h4kuna\Ares\Exception\ResultException;
6
use h4kuna\Ares\Exception\ServerResponseException;
7
use h4kuna\Ares\Http\TransportProvider;
8
use h4kuna\Ares\Tool\Strings;
9
use h4kuna\Ares\Tool\Xml;
10
use Psr\Http\Message\StreamInterface;
11
use stdClass;
12

13
/**
14
 * @see https://www.mojedatovaschranka.cz/sds/p/download/sds_webove_sluzby.pdf#view=Fit
15
 */
16
final class Client
17
{
18
        public static string $url = 'https://www.mojedatovaschranka.cz/sds/ws/call';
19

20
        public function __construct(
1✔
21
                private TransportProvider $requestProvider,
22
        ) {
23
        }
1✔
24

25
        /**
26
         * @throws ResultException
27
         * @throws ServerResponseException
28
         */
29
        public function request(StreamInterface $body): stdClass
1✔
30
        {
31
                $request = $this->requestProvider->createXmlRequest(self::$url, $body);
1✔
32

33
                $response = $this->requestProvider->response($request);
1✔
34

35
                $data = Xml::toJson($response);
1✔
36

37
                if (isset($data->Message)) {
1✔
NEW
38
                        throw ResultException::withMessage(Strings::fromMixedStrict($data->Message));
×
39
                } elseif (isset($data->Osoba) === false) {
1✔
NEW
40
                        throw ServerResponseException::badResponse('No content');
×
41
                }
42

43
                return $data;
1✔
44
        }
45

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