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

webeweb / haveibeenpwned-library / 8308916495

16 Mar 2024 04:04PM UTC coverage: 98.917%. Remained the same
8308916495

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 InvalidArgumentException;
17
use WBW\Library\HaveIBeenPwned\Request\BreachedAccountRequest;
18
use WBW\Library\HaveIBeenPwned\Response\BreachesResponse;
19
use WBW\Library\Provider\Exception\ApiException;
20

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

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

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

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

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