Add pjson support

This commit is contained in:
2024-06-29 11:46:16 -04:00
parent 50854275a8
commit 478684621c
8 changed files with 146 additions and 12 deletions

16
tests/PjsonDocument.php Normal file
View File

@@ -0,0 +1,16 @@
<?php declare(strict_types=1);
namespace Test;
use Square\Pjson\{Json, JsonSerialize};
/**
* A test document annotated with pjson attributes using the `JsonSerialize` trait
*/
class PjsonDocument
{
use JsonSerialize;
public function __construct(#[Json] public PjsonId $id = new PjsonId(''), #[Json] public string $name = '',
#[Json('num_value')] public int $numValue = 0, public string $skipped = 'yep') { }
}