Click.php
5 months ago
Event.php
5 months ago
Order.php
5 months ago
Origin.php
5 months ago
Submission.php
5 months ago
View.php
3 months ago
Event.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Journey\Events; |
| 4 | |
| 5 | use IAWPSCOPED\Carbon\CarbonImmutable; |
| 6 | use IAWP\Utils\Format; |
| 7 | /** @internal */ |
| 8 | abstract class Event |
| 9 | { |
| 10 | public abstract function type() : string; |
| 11 | public abstract function label() : string; |
| 12 | public abstract function created_at() : ?CarbonImmutable; |
| 13 | public abstract function html() : string; |
| 14 | public function created_at_for_humans() : string |
| 15 | { |
| 16 | $created_at = $this->created_at(); |
| 17 | if ($created_at === null) { |
| 18 | return ''; |
| 19 | } |
| 20 | return $created_at->format(Format::time()); |
| 21 | } |
| 22 | } |
| 23 |