pickup = new Pickup(); $this->delivery = new Delivery(); $this->insurance = new MoneyValue(); $this->valueOfGoods = new MoneyValue(); $this->cashOnDelivery = new MoneyValue(); } public function SetService(string $service) { $this->service = ShipmentService::from($service); } public function jsonSerialize() { $array = (array) $this; $array['dimensions'] = ''; return array_map(function ($value) { if (is_bool($value)) return $value ? 'Yes' : 'No'; return $value; }, $array); } }