Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| ProductMeasureResource | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| toArray | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\Product\Resources; |
| 4 | |
| 5 | use Illuminate\Http\Request; |
| 6 | use Illuminate\Http\Resources\Json\JsonResource; |
| 7 | |
| 8 | /** |
| 9 | * @property float $width |
| 10 | * @property float $height |
| 11 | * @property float $depth |
| 12 | * @property float $weight |
| 13 | * @property float $net_weight |
| 14 | * @property float $gross_weight |
| 15 | */ |
| 16 | class ProductMeasureResource extends JsonResource |
| 17 | { |
| 18 | |
| 19 | public function toArray(Request $request): array |
| 20 | { |
| 21 | return [ |
| 22 | 'width' => $this->width, |
| 23 | 'height' => $this->height, |
| 24 | 'depth' => $this->depth, |
| 25 | 'weight' => $this->weight, |
| 26 | 'net_weight' => $this->net_weight, |
| 27 | 'gross_weight' => $this->gross_weight, |
| 28 | ]; |
| 29 | } |
| 30 | |
| 31 | } |