Issues (57)

src/Models/macros/string.php (5 issues)

1
<?php
2
3
use Illuminate\Database\Eloquent\Builder;
4
5
Builder::macro('label', function ($label, $key = 'label') {
6
    return $this->where($key, $label);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
7
});
8
9
Builder::macro('name', function ($name, $key = 'name') {
10
    return $this->where($key, $name);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
11
});
12
13
Builder::macro('code', function ($code, $key = 'code') {
0 ignored issues
show
The parameter $key is not used and could be removed. ( Ignorable by Annotation )

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

13
Builder::macro('code', function ($code, /** @scrutinizer ignore-unused */ $key = 'code') {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
    return $this->where($code, $code);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
15
});
16
17
Builder::macro('reference', function ($reference, $key = 'reference') {
18
    return $this->where($key, $reference);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
19
});
20