Issues (115)

src/macro/relation.php (2 issues)

1
<?php
2
3
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
4
use Illuminate\Database\Eloquent\Relations\HasMany;
5
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
6
use Illuminate\Database\Eloquent\Relations\MorphMany;
7
use Illuminate\Database\Eloquent\Relations\MorphToMany;
8
use Illuminate\Database\Eloquent\Relations\Relation;
9
10
Relation::macro(
0 ignored issues
show
The method macro() does not exist on Illuminate\Database\Eloquent\Relations\Relation. It seems like you code against a sub-type of Illuminate\Database\Eloquent\Relations\Relation such as Illuminate\Database\Eloquent\Relations\MorphTo. ( Ignorable by Annotation )

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

10
Relation::/** @scrutinizer ignore-call */ 
11
          macro(
Loading history...
11
    'isToMany',
12
    function (): bool {
13
        return is_a($this, HasMany::class) || is_a($this, BelongsToMany::class)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
14
            || is_a($this, MorphMany::class) || is_a($this, MorphToMany::class)
15
            || is_a($this, HasManyThrough::class);
16
    }
17
);
18