Skip to content

Unused variable #2

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);
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions