← Code-Übersicht

SystemClock.php

Pfad: src/Infrastructure/Rechnung/SystemClock.php

Ext: php

Größe: 401 Bytes

Geändert: 2026-07-16 14:11:10+02

<?php
declare(strict_types=1);

namespace Demo\Infrastructure\Rechnung;

use Demo\Domain\Rechnung\ClockPort;

/**
 * Uhrzeitadapter auf Basis von DateTimeImmutable.
 */
final class SystemClock implements ClockPort
{
    /**
     * @return string Aktueller Zeitpunkt (ISO-8601).
     */
    public function now(): string
    {
        return (new \DateTimeImmutable('now'))->format(DATE_ATOM);
    }
}