| @@ 143-149 (lines=7) @@ | ||
| 140 | array $array, |
|
| 141 | bool $writeAll = false |
|
| 142 | ) : DaftJson { |
|
| 143 | if (false === is_a(static::class, DaftJson::class, true)) { |
|
| 144 | throw new BadMethodCallException( |
|
| 145 | static::class . |
|
| 146 | ' does not implement ' . |
|
| 147 | DaftJson::class |
|
| 148 | ); |
|
| 149 | } |
|
| 150 | ||
| 151 | $in = []; |
|
| 152 | ||
| @@ 262-268 (lines=7) @@ | ||
| 259 | ||
| 260 | public static function DaftObjectFromJsonString(string $string) : DaftJson |
|
| 261 | { |
|
| 262 | if (false === is_a(static::class, DaftJson::class, true)) { |
|
| 263 | throw new BadMethodCallException( |
|
| 264 | static::class . |
|
| 265 | ' does not implement ' . |
|
| 266 | DaftJson::class |
|
| 267 | ); |
|
| 268 | } |
|
| 269 | ||
| 270 | return static::DaftObjectFromJsonArray(json_decode($string, true)); |
|
| 271 | } |
|
| @@ 150-156 (lines=7) @@ | ||
| 147 | */ |
|
| 148 | final public static function DaftObjectJsonProperties() : array |
|
| 149 | { |
|
| 150 | if (false === is_a(static::class, DaftJson::class, true)) { |
|
| 151 | throw new BadMethodCallException( |
|
| 152 | static::class . |
|
| 153 | ' does not implement ' . |
|
| 154 | DaftJson::class |
|
| 155 | ); |
|
| 156 | } |
|
| 157 | ||
| 158 | return static::JSON_PROPERTIES; |
|
| 159 | } |
|