cleaniquecoders /
blueprint-macro
| 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
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
|
|||||
| 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
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
|
|||||
| 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
|
|||||
| 19 | }); |
||||
| 20 |