php-kilo/src/Type/StatusMessage.php

16 lines
287 B
PHP
Raw Normal View History

<?php declare(strict_types=1);
namespace Aviat\Kilo\Type;
class StatusMessage {
private function __construct(
public string $text,
2021-03-17 15:38:52 -04:00
public int $len,
public int $time,
) {}
2021-03-17 15:38:52 -04:00
public static function from(string $text): self
{
2021-03-17 15:38:52 -04:00
return new self($text, strlen($text), time());
}
}