1: <?php declare( strict_types = 1 );
2:
3: namespace Waves\Common;
4:
5: class JsonBase
6: {
7: protected Json $json;
8:
9: function __construct( Json $json = null )
10: {
11: if( !isset( $json ) )
12: $json = Json::as( [] );
13: $this->json = $json;
14: }
15:
16: function toString(): string
17: {
18: return $this->json->toString();
19: }
20:
21: function json(): Json
22: {
23: return $this->json;
24: }
25: }
26: