TemplateFilter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
1
<?php
2
3
namespace App\Filters;
4
5
use EloquentFilter\ModelFilter;
6
7
class TemplateFilter extends ModelFilter
8
{
9
    /**
10
     * Related Models that have ModelFilters as well as the method on the ModelFilter
11
     * As [relatedModel => [input_key1, input_key2]].
12
     *
13
     * @var array
14
     */
15
    public $relations = [];
16
17
    /**
18
     * @param $name
19
     * @return $this
20
     */
21
    public function name($name)
22
    {
23
        return $this->where('name', 'LIKE', '%'.$name.'%');
0 ignored issues
show
Bug introduced by
The method where() does not exist on App\Filters\TemplateFilter. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

23
        return $this->/** @scrutinizer ignore-call */ where('name', 'LIKE', '%'.$name.'%');
Loading history...
24
    }
25
}
26