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

jorge07 / symfony-5-es-cqrs-boilerplate / #166

06 Feb 2026 10:12AM UTC coverage: 88.404% (+1.2%) from 87.168%
#166

push

web-flow
Merge c345ce76d into 847c843ce

36 of 45 new or added lines in 21 files covered. (80.0%)

9 existing lines in 4 files now uncovered.

587 of 664 relevant lines covered (88.4%)

8.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/App/User/Infrastructure/Persistence/Doctrine/Types/HashedPasswordType.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\User\Infrastructure\Persistence\Doctrine\Types;
6

7
use App\User\Domain\ValueObject\Auth\HashedPassword;
8
use Doctrine\DBAL\Platforms\AbstractPlatform;
9
use Doctrine\DBAL\Types\ConversionException;
10
use Doctrine\DBAL\Types\StringType;
11
use Throwable;
12

13
final class HashedPasswordType extends StringType
14
{
15
    private const TYPE = 'hashed_password';
16

17
    /**
18
     * @throws ConversionException
19
     */
20
    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string
21
    {
22
        if (null === $value) {
24✔
23
            return null;
×
24
        }
25

26
        if (!$value instanceof HashedPassword) {
24✔
27
            throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', HashedPassword::class]);
×
28
        }
29

30
        return $value->toString();
24✔
31
    }
32

33
    /**
34
     * @throws ConversionException
35
     */
36
    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?HashedPassword
37
    {
38
        if (null === $value || $value instanceof HashedPassword) {
13✔
39
            return $value;
×
40
        }
41

42
        try {
43
            $hashedPassword = HashedPassword::fromHash($value);
13✔
44
        } catch (Throwable) {
×
NEW
45
            throw ConversionException::conversionFailedFormat($value, $this->getName(), 'a valid hashed password');
×
46
        }
47

48
        return $hashedPassword;
13✔
49
    }
50

51
    public function getName(): string
52
    {
53
        return self::TYPE;
×
54
    }
55
}
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

© 2026 Coveralls, Inc