Issues (17)

src/Traits/HasBansRelation.php (1 issue)

Labels
Severity
1
<?php
2
3
/*
4
 * This file is part of Laravel Ban.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Ban\Traits;
15
16
use Cog\Contracts\Ban\Ban as BanContract;
17
use Illuminate\Database\Eloquent\Relations\MorphMany;
18
19
trait HasBansRelation
20
{
21
    /**
22
     * Entity Bans.
23
     *
24
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
25
     */
26
    public function bans(): MorphMany
27
    {
28
        return $this->morphMany(app(BanContract::class), 'bannable');
0 ignored issues
show
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

28
        return $this->/** @scrutinizer ignore-call */ morphMany(app(BanContract::class), 'bannable');
Loading history...
29
    }
30
}
31