Total Complexity | 4 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | trait Attribute |
||
16 | { |
||
17 | /** |
||
18 | * Return "quantity" attribute value. |
||
19 | * |
||
20 | * @return int |
||
21 | */ |
||
22 | public function getQuantityAttribute(): int |
||
23 | { |
||
24 | return $this->quantity_per_bundle * $this->bundle_quantity; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Return "denomination_name" attribute value. |
||
29 | * |
||
30 | * @return string |
||
31 | */ |
||
32 | public function getDenominationNameAttribute(): string |
||
33 | { |
||
34 | return $this->denomination->name; |
||
|
|||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Return "denomination_value" attribute value. |
||
39 | * |
||
40 | * @return float |
||
41 | */ |
||
42 | public function getDenominationValueAttribute(): float |
||
43 | { |
||
44 | return $this->denomination->value; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Return "total" attribute value. |
||
49 | * |
||
50 | * @return float |
||
51 | */ |
||
52 | public function getTotalAttribute(): float |
||
55 | } |
||
56 | } |
||
57 |