| 123456789101112131415161718192021 |
- <?php
-
- namespace App\Commerce\Shipping\EasyParcel;
-
- /**
- * The box being sent: weight in grams, size in centimetres.
- */
- final readonly class Parcel
- {
- public function __construct(
- public int $grams,
- public int $length,
- public int $width,
- public int $height,
- ) {}
-
- public function kilograms(): float
- {
- return round(max($this->grams, 10) / 1000, 2);
- }
- }
|