1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Core\Entity; |
4: | |
5: | use DateTimeImmutable; |
6: | use DateTimeInterface; |
7: | |
8: | /** |
9: | * @api |
10: | */ |
11: | interface Temporal |
12: | { |
13: | /** |
14: | * Get properties that accept date and time values |
15: | * |
16: | * Date and time values are always converted to {@see DateTimeImmutable} |
17: | * instances for declared and "magic" properties that accept |
18: | * {@see DateTimeImmutable} and/or return {@see DateTimeInterface}. This |
19: | * method may be used to nominate untyped properties for the same treatment. |
20: | * |
21: | * If `["*"]` is returned and the class has no declared or "magic" |
22: | * properties with compatible type hints, date and time values are converted |
23: | * to {@see DateTimeImmutable} instances for all properties. |
24: | * |
25: | * Properties returned must accept {@see DateTimeImmutable} and/or return |
26: | * {@see DateTimeInterface}. |
27: | * |
28: | * @return string[] |
29: | */ |
30: | public static function getDateProperties(): array; |
31: | } |
32: |