$this->type ]; switch ($this->type) { case ModificationType::INCREASE_PRICE: case ModificationType::DECREASE_PRICE: return $type + [ 'value' => $this->value ]; case ModificationType::INCREASE_PERCENTAGE: case ModificationType::DECREASE_PERCENTAGE: return $type + [ 'percentage' => (string)$this->percentage ]; default: return $type + [ 'price' => $this->price ]; } } }