Issues (7)

src/EloquentHasByJoinServiceProvider.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Mpyw\EloquentHasByJoin;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use Illuminate\Support\ServiceProvider;
7
8
class EloquentHasByJoinServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register Eloquent\Builder::hasByJoin() macro.
12
     */
13 15
    public function boot(): void
14
    {
15 15
        Builder::macro('hasByJoin', function ($relationMethod, ?callable ...$constraints): Builder {
0 ignored issues
show
The method macro() does not exist on Illuminate\Database\Eloquent\Builder. ( Ignorable by Annotation )

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

15
        Builder::/** @scrutinizer ignore-call */ 
16
                 macro('hasByJoin', function ($relationMethod, ?callable ...$constraints): Builder {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16
            /** @var \Illuminate\Database\Eloquent\Builder $query */
17 15
            $query = $this;
18 15
            return (new HasByJoinMacro($query))($relationMethod, ...$constraints);
19 15
        });
20
    }
21
}
22