Total Complexity | 7 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
18 | class RedisStorage extends Storage |
||
19 | { |
||
20 | /** |
||
21 | * @var Client |
||
22 | */ |
||
23 | protected $client; |
||
24 | |||
25 | 1 | public function __construct(Client $client) |
|
26 | { |
||
27 | 1 | $this->client = $client; |
|
28 | } |
||
29 | |||
30 | 2 | public function store(Password $password, bool $allowOverwrite = false): void |
|
31 | { |
||
32 | 2 | if (!$allowOverwrite && $this->get($password->getId())) { |
|
33 | 1 | throw new PhPsstException('The ID already exists', PhPsstException::ID_IS_ALREADY_TAKEN); |
|
34 | } |
||
35 | 1 | $this->client->set($password->getId(), $password->getJson()); |
|
36 | 1 | $this->client->expireat($password->getId(), $password->getTtl()); |
|
37 | } |
||
38 | |||
39 | 1 | public function get(string $key): ?Password |
|
40 | { |
||
41 | 1 | $password = null; |
|
42 | 1 | if (($passwordData = $this->client->get($key))) { |
|
43 | 1 | $password = $this->getPasswordFromJson($passwordData); |
|
44 | } |
||
45 | |||
46 | 1 | return $password; |
|
47 | } |
||
48 | |||
49 | 1 | public function delete(Password $password): void |
|
52 | } |
||
53 | } |
||
54 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths