public function serialize($value) : string { if (null !== $value && !is_array($value)) { throw InvalidValueException::valueDoesNotMatchType($this, $value); } return json_encode($value); }