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

HasIssuerable   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A issuers() 0 3 1
1
<?php
2
3
namespace App\Models\Support;
4
5
use Illuminate\Database\Eloquent\Relations\MorphMany;
6
7
/**
8
 * @property-read \Illuminate\Database\Eloquent\Collection<\App\Models\OrderStatus> $issuers
9
 */
10
trait HasIssuerable
11
{
12
    /**
13
     * Define a polymorphic one-to-many relationship with \App\Models\OrderStatus.
14
     *
15
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
16
     */
17
    public function issuers(): MorphMany
18
    {
19
        return $this->morphMany(OrderStatus::class, 'issuerable');
0 ignored issues
show
Bug introduced by
The type App\Models\Support\OrderStatus was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Bug introduced by
It seems like morphMany() 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

19
        return $this->/** @scrutinizer ignore-call */ morphMany(OrderStatus::class, 'issuerable');
Loading history...
20
    }
21
}
22