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

h4kuna / ares / 22293219950

22 Feb 2026 12:32PM UTC coverage: 84.701% (-4.8%) from 89.497%
22293219950

push

github

web-flow
Merge pull request #51 from h4kuna/php-coding-standard

Add coding standards

38 of 47 new or added lines in 16 files covered. (80.85%)

19 existing lines in 5 files now uncovered.

382 of 451 relevant lines covered (84.7%)

0.85 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