Passed
Push — develop ( a95732...cd40df )
by Septianata
12:51
created

Configuration::getMaximumTotalOrderValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use App\Infrastructure\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Factories\HasFactory;
7
8
class Configuration extends Model
9
{
10
    use HasFactory,
11
        Concerns\Configuration\Attribute;
12
13
    /**
14
     * Return configuration value of "maximum_total_order_value".
15
     *
16
     * @return float
17
     */
18
    public static function getMaximumTotalOrderValue(): float
19
    {
20
        return (float) static::where('key', 'maximum_total_order_value')->first('value')->value;
21
    }
22
}
23