Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| HourAndMinutes | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| getDateFormat | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isStrictFormat | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\DateValueObjects; |
| 3 | |
| 4 | use Apie\DateValueObjects\Concerns\CanCreateInstanceFromDateTimeObject; |
| 5 | use Apie\DateValueObjects\Concerns\CanHaveTimeIntervals; |
| 6 | use Apie\DateValueObjects\Concerns\IsDateValueObject; |
| 7 | use Apie\DateValueObjects\Interfaces\WorksWithTimeIntervals; |
| 8 | |
| 9 | /** |
| 10 | * Represents a time only in a 24h format accurate to |
| 11 | * the second. |
| 12 | * |
| 13 | * For example: |
| 14 | * 01:00, 23:00 |
| 15 | * |
| 16 | * Hours lower than 10 will be prefixed with 0. |
| 17 | */ |
| 18 | final class HourAndMinutes implements WorksWithTimeIntervals |
| 19 | { |
| 20 | use CanCreateInstanceFromDateTimeObject; |
| 21 | use CanHaveTimeIntervals; |
| 22 | use IsDateValueObject; |
| 23 | |
| 24 | public static function getDateFormat(): string |
| 25 | { |
| 26 | return 'H:i'; |
| 27 | } |
| 28 | |
| 29 | protected function isStrictFormat(): bool |
| 30 | { |
| 31 | return false; |
| 32 | } |
| 33 | } |