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

webeweb / haveibeenpwned-library / 4101946401

pending completion
4101946401

push

github

webeweb
Update CHANGELOG

240 of 244 relevant lines covered (98.36%)

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

12
namespace WBW\Library\HaveIBeenPwned\Provider;
13

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

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

28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getEndpointVersion(): string {
32
        return "";
21✔
33
    }
34

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

46
        $queryData   = $request->serializeRequest();
14✔
47
        $rawResponse = $this->callApi($request, $queryData);
14✔
48

49
        return $request->deserializeResponse($rawResponse);
×
50
    }
51
}
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