KabsaRelationships   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hasManyKabsaRows() 0 3 1
A belongsToKabsaRow() 0 3 1
1
<?php
2
3
4
namespace Awssat\Kabsa\Traits;
5
6
use Awssat\Kabsa\Relationships\BelongsToCached;
7
use Awssat\Kabsa\Relationships\HasManyCached;
8
9
trait KabsaRelationships
10
{
11
    public function belongsToKabsaRow($related,  $foreignKey = null, $ownerKey = null)
12
    {
13
        return new BelongsToCached($related, $this, $foreignKey, $ownerKey);
0 ignored issues
show
Bug introduced by
$this of type Awssat\Kabsa\Traits\KabsaRelationships is incompatible with the type Illuminate\Database\Eloquent\Model expected by parameter $parent of Awssat\Kabsa\Relationshi...ToCached::__construct(). ( Ignorable by Annotation )

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

13
        return new BelongsToCached($related, /** @scrutinizer ignore-type */ $this, $foreignKey, $ownerKey);
Loading history...
14
    }
15
16
    public function hasManyKabsaRows($related,  $foreignKey = null, $ownerKey = null)
17
    {
18
        return new HasManyCached($related, $this, $foreignKey, $ownerKey);
0 ignored issues
show
Bug introduced by
$this of type Awssat\Kabsa\Traits\KabsaRelationships is incompatible with the type Illuminate\Database\Eloquent\Model expected by parameter $parent of Awssat\Kabsa\Relationshi...nyCached::__construct(). ( Ignorable by Annotation )

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

18
        return new HasManyCached($related, /** @scrutinizer ignore-type */ $this, $foreignKey, $ownerKey);
Loading history...
19
    }
20
}