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

webeweb / haveibeenpwned-library / 8265160552

13 Mar 2024 01:05PM UTC coverage: 98.917% (+0.4%) from 98.566%
8265160552

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
/*
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 "";
24✔
33
    }
34

35
    /**
36
     * Send 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();
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