Passed
Push — develop ( 16ae21...f7a059 )
by Septianata
04:44
created

Attribute::getItemTotalBundleQuantityAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace App\Models\Concerns\Order;
4
5
use App\Enum\OrderStatus;
6
7
/**
8
 * @property string $code
9
 * @property \App\Enum\OrderStatus $status
10
 * @property \Illuminate\Support\Carbon $schedule_date
11
 * @property-read mixed $item_total_bundle_quantity
12
 * @property-read mixed $item_total
13
 *
14
 * @see \App\Models\Order
15
 */
16
trait Attribute
17
{
18
    /**
19
     * Return "status" attribute value.
20
     *
21
     * @return \App\Enum\OrderStatus
22
     */
23
    public function getStatusAttribute(): OrderStatus
24
    {
25
        return $this->latestStatus->status;
26
    }
27
28
    /**
29
     * Return "item_total_bundle_quantity" attribute value.
30
     *
31
     * @return int
32
     */
33
    public function getItemTotalBundleQuantityAttribute($value): int
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

33
    public function getItemTotalBundleQuantityAttribute(/** @scrutinizer ignore-unused */ $value): int

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
    {
35
        return $this->items->sum->bundle_quantity;
36
    }
37
38
    /**
39
     * Return "item_total" attribute value.
40
     *
41
     * @return float
42
     */
43
    public function getItemTotalAttribute($value): float
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

43
    public function getItemTotalAttribute(/** @scrutinizer ignore-unused */ $value): float

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
    {
45
        return $this->items->sum->total;
46
    }
47
}
48