HasPaymentMethodRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 4
dl 0
loc 11
rs 10
c 2
b 1
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initRelationsPaymentMethod() 0 3 1
A initRelations() 0 4 1
1
<?php
2
3
namespace ByTIC\Payments\Models\AbstractModels\HasPaymentMethod;
4
5
use ByTIC\Payments\Models\Methods\PaymentMethod;
6
use ByTIC\Payments\Utility\PaymentsModels;
7
8
/**
9
 * Trait HasPaymentMethodRecord
10
 * @package ByTIC\Payments\Models\AbstractModels\HasPaymentMethod
11
 *
12
 * @property int $id_method
13
 */
14
trait HasPaymentMethodRepository
15
{
16
    public function initRelations()
17
    {
18
        parent::initRelations();
19
        $this->initRelationsPaymentMethod();
20
    }
21
22
    protected function initRelationsPaymentMethod()
23
    {
24
        $this->belongsTo('PaymentMethod', ['class' => get_class(PaymentsModels::methods()), 'fk' => 'id_method']);
0 ignored issues
show
Bug introduced by
It seems like belongsTo() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

24
        $this->/** @scrutinizer ignore-call */ 
25
               belongsTo('PaymentMethod', ['class' => get_class(PaymentsModels::methods()), 'fk' => 'id_method']);
Loading history...
25
    }
26
}
27