Could this be reduced to:

```php
if (empty($conditions['sort'])) {
  unset($conditions['sort']);
}
```

empty and unset should not throw notices for undefined indexes.