Daniel J. Summers
d067f8983f
- Add In/InArray support - Add ORDER BY support for `Find` functions - Update dependencies - Implement fixes identified via static analysis Reviewed-on: #5
35 lines
659 B
PHP
35 lines
659 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
|
|
*/
|
|
final class PjsonId implements JsonDataSerializable
|
|
{
|
|
public function __construct(protected string $value) { }
|
|
|
|
public function toJsonData(): string
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $jd JSON data
|
|
* @param mixed[]|string $path path segments
|
|
* @return static
|
|
*/
|
|
public static function fromJsonData($jd, array|string $path = []): static
|
|
{
|
|
return new static($jd);
|
|
}
|
|
}
|