Backup #1906
| ID | 1906 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/Domain/ValueObject/MessageTiming.php |
| Version | 1 |
| Typ |
modified |
| Größe | 1.9 KB |
| Hash | 7fdb503b10dfcf2b086c92fa0dd918c491d69fae837b76a780b1a4eb1e4851f6 |
| Datum | 2025-12-28 01:06:40 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php
declare(strict_types=1);
namespace Domain\ValueObject;
// @responsibility: Immutable Value Object for message timing (performance tracking)
use InvalidArgumentException;
final class MessageTiming
{
private ?float $startMicrotime;
private ?float $endMicrotime;
private function __construct(?float $startMicrotime, ?float $endMicrotime)
{
if ($startMicrotime !== null && $endMicrotime !== null && $endMicrotime < $startMicrotime) {
throw new InvalidArgumentException('End time cannot be before start time');
}
$this->startMicrotime = $startMicrotime;
$this->endMicrotime = $endMicrotime;
}
public static function create(?float $startMicrotime, ?float $endMicrotime): self
{
return new self($startMicrotime, $endMicrotime);
}
public static function none(): self
{
return new self(null, null);
}
public static function started(float $startMicrotime): self
{
return new self($startMicrotime, null);
}
public function startMicrotime(): ?float
{
return $this->startMicrotime;
}
public function endMicrotime(): ?float
{
return $this->endMicrotime;
}
public function durationMs(): ?float
{
if ($this->startMicrotime === null || $this->endMicrotime === null) {
return null;
}
return ($this->endMicrotime - $this->startMicrotime) * 1000;
}
public function isComplete(): bool
{
return $this->startMicrotime !== null && $this->endMicrotime !== null;
}
public function withEnd(float $endMicrotime): self
{
return new self($this->startMicrotime, $endMicrotime);
}
public function equals(self $other): bool
{
return $this->startMicrotime === $other->startMicrotime
&& $this->endMicrotime === $other->endMicrotime;
}
}
Vollständig herunterladen
Aktionen
Andere Versionen dieser Datei
| ID |
Version |
Typ |
Größe |
Datum |
| 1909 |
2 |
modified |
1.9 KB |
2025-12-28 01:07 |
| 1906 |
1 |
modified |
1.9 KB |
2025-12-28 01:06 |
← Zurück zur Übersicht