pdo-document/tests/PjsonId.php
Daniel J. Summers d8330d828a Derive mode from DSN function
- Add headers in all files
- Minor field name changes
2024-07-20 21:47:21 -04:00

30 lines
532 B
PHP

<?php
/**
* @author Daniel J. Summers <daniel@bitbadger.solutions>
* @license MIT
*/
declare(strict_types=1);
namespace Test;
use Square\Pjson\JsonDataSerializable;
/**
* A serializable ID wrapper class
*/
class PjsonId implements JsonDataSerializable
{
public function __construct(protected string $value) { }
public function toJsonData(): string
{
return $this->value;
}
public static function fromJsonData($jd, array|string $path = []): static
{
return new static($jd);
}
}