Skip to content

Unused variable #2

@jasekiw

Description

@jasekiw

It doesn't seem like the $wheres variable is used at all. What is it's purpose?

public function remove(Builder $builder, Model $model)
{
$query = $builder->getQuery();
$wheres = [
'type' => 'Basic',
'column' => 'post_type',
'operator' => '>=',
'value' => 'form',
'boolean' => 'and',
];
foreach ((array) $query->wheres as $key => $where) {
if ($where['type'] !== 'Basic'
|| (string) $where['column'] !== '('.self::$apiEnabledScopeColumn.')'
|| $where['operator'] !== '>='
|| (int) $where['value'] !== 1
|| $where['boolean'] !== 'and') {
continue;
}
unset($query->wheres[$key]);
$query->wheres = array_values($query->wheres);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions