2021-03-11 16:56:02 -05:00
|
|
|
<?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,
|
2021-03-11 16:56:02 -05:00
|
|
|
public int $time,
|
|
|
|
) {}
|
|
|
|
|
2021-03-17 15:38:52 -04:00
|
|
|
public static function from(string $text): self
|
2021-03-11 16:56:02 -05:00
|
|
|
{
|
2021-03-17 15:38:52 -04:00
|
|
|
return new self($text, strlen($text), time());
|
2021-03-11 16:56:02 -05:00
|
|
|
}
|
|
|
|
}
|