Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
PlaintextPasswordHasher
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 hash
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 verify
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3// ╔════════════════════════════════════════════════════════════╗
4// ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║
5// ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com>     ║
6// ╚════════════════════════════════════════════════════════════╝
7
8declare(strict_types=1);
9
10namespace Phexium\Plugin\PasswordHasher\Adapter;
11
12use Override;
13use Phexium\Plugin\PasswordHasher\Port\PasswordHasherInterface;
14
15final readonly class PlaintextPasswordHasher implements PasswordHasherInterface
16{
17    #[Override]
18    public function hash(string $plainPassword): string
19    {
20        return '$plain$'.$plainPassword;
21    }
22
23    #[Override]
24    public function verify(string $plainPassword, string $hash): bool
25    {
26        return $hash === $this->hash($plainPassword);
27    }
28}