Files
AeonDumpManager/src/Struct/DumpFile.php
T

30 lines
742 B
PHP

<?php declare(strict_types=1);
namespace AeonDumpManager\Struct;
/**
* A dump on disk. Not a DAL entity — dumps are plain files in the plugin's
* private Flysystem mount, identified by their filename.
*/
final class DumpFile
{
public function __construct(
public readonly string $filename,
public readonly \DateTimeImmutable $datetime,
public readonly int $sizeBytes,
) {
}
/**
* @return array{filename: string, datetime: string, sizeBytes: int}
*/
public function jsonSerialize(): array
{
return [
'filename' => $this->filename,
'datetime' => $this->datetime->format(DATE_ATOM),
'sizeBytes' => $this->sizeBytes,
];
}
}