Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
Md5Checksum | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
getRegularExpression | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
convert | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | namespace Apie\Core\ValueObjects; |
3 | |
4 | use Apie\Core\Attributes\Description; |
5 | use Apie\Core\ValueObjects\Interfaces\HasRegexValueObjectInterface; |
6 | |
7 | #[Description('Represents a md5 checksum')] |
8 | class Md5Checksum implements HasRegexValueObjectInterface |
9 | { |
10 | use IsStringWithRegexValueObject; |
11 | |
12 | public static function getRegularExpression(): string |
13 | { |
14 | return '/^[a-f0-9]{32}$/'; |
15 | } |
16 | |
17 | protected function convert(string $input): string |
18 | { |
19 | return strtolower($input); |
20 | } |
21 | } |