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

webeweb / haveibeenpwned-library / 8306904586

16 Mar 2024 09:46AM UTC coverage: 98.917%. Remained the same
8306904586

push

github

webeweb
Update CHANGELOG

274 of 277 relevant lines covered (98.92%)

49.94 hits per line

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

75.0
/src/Provider/APIv1Provider.php
1
<?php
2

3
declare(strict_types = 1);
4

5
/*
6
 * This file is part of the haveibeenpwned-library package.
7
 *
8
 * (c) 2019 WEBEWEB
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13

14
namespace WBW\Library\HaveIBeenPwned\Provider;
15

16
use GuzzleHttp\Exception\GuzzleException;
17
use InvalidArgumentException;
18
use WBW\Library\HaveIBeenPwned\Request\BreachedAccountRequest;
19
use WBW\Library\HaveIBeenPwned\Response\BreachesResponse;
20
use WBW\Library\Provider\Exception\ApiException;
21

22
/**
23
 * API v1 provider.
24
 *
25
 * @author webeweb <https://github.com/webeweb>
26
 * @package WBW\Library\HaveIBeenPwned\Provider
27
 */
28
class APIv1Provider extends AbstractProvider {
29

30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function getEndpointVersion(): string {
34
        return "";
24✔
35
    }
36

37
    /**
38
     * Send a request.
39
     *
40
     * @param BreachedAccountRequest $request The request.
41
     * @return BreachesResponse Returns the response.
42
     * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing.
43
     * @throws GuzzleException Throws a Guzzle exception if an error occurs.
44
     * @throws ApiException Throws an API exception if an error occurs.
45
     */
46
    public function sendRequest(BreachedAccountRequest $request): BreachesResponse {
47

48
        $queryData   = $request->serializeRequest();
16✔
49
        $rawResponse = $this->callApi($request, $queryData);
16✔
50

51
        /** @var BreachesResponse */
52
        return $request->deserializeResponse($rawResponse);
×
53
    }
54
}
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

© 2025 Coveralls, Inc