Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5namespace Icawebdesign\Hibp\Password;
6
7use Icawebdesign\Hibp\HibpHttp;
8use Illuminate\Support\Collection;
9use Psr\Http\Message\ResponseInterface;
10
11interface PwnedPasswordInterface
12{
13    public function __construct(HibpHttp $hibpHttp);
14
15    /**
16     * @param string $hash
17     * @param array<string, mixed> $options
18     *
19     * @return int
20     */
21    public function rangeFromHash(string $hash, array $options): int;
22
23    /**
24     * @param string $hash
25     * @param array<string, mixed> $options
26     *
27     * @return int
28     */
29    public function ntlmRangeFromHash(string $hash, array $options): int;
30
31    /**
32     * @param string $hash
33     * @param array<string, mixed> $options
34     *
35     * @return Collection<int, string>
36     */
37    public function rangeDataFromHash(string $hash, array $options): Collection;
38
39    /**
40     * @param string $hash
41     * @param array<string, mixed> $options
42     *
43     * @return int
44     */
45    public function paddedRangeFromHash(string $hash, array $options): int;
46
47    /**
48     * @param string $hash
49     * @param array<string, mixed> $options
50     *
51     * @return int
52     */
53    public function paddedNtlmRangeFromHash(string $hash, array $options): int;
54
55    /**
56     * @param string $hash
57     * @param array<string, mixed> $options
58     *
59     * @return Collection<int, string>
60     */
61    public function paddedRangeDataFromHash(string $hash, array $options): Collection;
62
63    /**
64     * @param ResponseInterface $response
65     * @param string $hash
66     *
67     * @return Collection<int, Collection<string, PwnedPasswordEntity>>
68     */
69    public function getRangeDataWithPadding(ResponseInterface $response, string $hash): Collection;
70
71    /**
72     * @param Collection<string, PwnedPasswordEntity> $data
73     * @param string $hash
74     *
75     * @return Collection<string, PwnedPasswordEntity>
76     */
77    public static function stripZeroMatchesData(Collection $data, string $hash): Collection;
78
79    /**
80     * @param ResponseInterface $response
81     * @param string $hash
82     *
83     * @return Collection<int, Collection<string, PwnedPasswordEntity>>
84     */
85    public function getRangeData(ResponseInterface $response, string $hash): Collection;
86}