PaymentCategory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A store() 0 9 1
1
<?php
2
3
namespace App\Models;
4
5
/**
6
 * Class PaymentCategory.
7
 */
8
class PaymentCategory extends ChocolateyModel
9
{
10
    /**
11
     * Disable Timestamps.
12
     *
13
     * @var bool
14
     */
15
    public $timestamps = false;
16
17
    /**
18
     * The table associated with the model.
19
     *
20
     * @var string
21
     */
22
    protected $table = 'chocolatey_shop_payment_categories';
23
24
    /**
25
     * Primary Key of the Table.
26
     *
27
     * @var string
28
     */
29
    protected $primaryKey = 'id';
30
31
    /**
32
     * Store an Shop Country.
33
     *
34
     * @param string $paymentName
35
     *
36
     * @return PaymentCategory
37
     */
38
    public function store(string $paymentName): PaymentCategory
39
    {
40
        $this->attributes['payment_type'] = $paymentName;
41
        $this->timestamps = false;
42
43
        $this->save();
44
45
        return $this;
46
    }
47
}
48