| 1 | <?php |
||
| 5 | class WithAttributeValueAndOperatorCriterion implements CriterionInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | protected $attribute; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $value; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $operator; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param string $attribute |
||
| 24 | * @param string $value |
||
| 25 | * @param string $operator |
||
| 26 | */ |
||
| 27 | public function __construct($attribute, $value, $operator = '=') |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
| 36 | * |
||
| 37 | * @return \Illuminate\Database\Eloquent\Builder |
||
| 38 | */ |
||
| 39 | public function apply($query) |
||
| 45 | } |
||
| 46 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: