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

h4kuna / ares / 22277191237

22 Feb 2026 12:31PM UTC coverage: 89.348% (-0.1%) from 89.497%
22277191237

Pull #51

github

web-flow
Merge dba0e9c78 into 1ba62fd0b
Pull Request #51: Add coding standards

40 of 47 new or added lines in 16 files covered. (85.11%)

1 existing line in 1 file now uncovered.

411 of 460 relevant lines covered (89.35%)

0.89 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

19
        public static string $url = 'https://www.mojedatovaschranka.cz/sds/ws/call';
20

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

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

35
                $response = $this->requestProvider->response($request);
1✔
36

37
                $data = Xml::toJson($response);
1✔
38

39
                if (isset($data->Message)) { // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
1✔
NEW
40
                        throw ResultException::withMessage(Strings::fromMixedStrict($data->Message)); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
×
41
                } elseif (isset($data->Osoba) === false) { // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
1✔
UNCOV
42
                        throw ServerResponseException::badResponse('No content');
×
43
                }
44

45
                return $data;
1✔
46
        }
47

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