Move files, complete PHP migration

The application works the same way as the F# version
This commit is contained in:
2024-06-23 16:35:55 -04:00
parent 9421bb2035
commit 20ad50928a
37 changed files with 354 additions and 301 deletions

View File

@@ -0,0 +1,25 @@
<?php declare(strict_types=1);
namespace MyPrayerJournal\Domain;
use JsonSerializable;
/**
* A record of an action taken on a request
*/
class History implements JsonSerializable
{
/**
* @param string $asOf The date/time this entry was made
* @param RequestAction $action The action taken for this history entry
* @param string|null $text The text for this history entry (optional)
*/
public function __construct(public string $asOf, public RequestAction $action, public ?string $text = null) { }
public function jsonSerialize(): mixed
{
$values = ['asOf' => $this->asOf, 'action' => $this->action->value];
if (isset($this->text)) $values['text'] = $this->text;
return $values;
}
}