$centsPerKg */ public function __construct(private array $centsPerKg) {} public function freightCents(Parcel $parcel, Route $route): int { $grams = $parcel->billableGrams($route); return intdiv($grams * $this->centsPerKg[$route->value] + 999, 1000); } }