I would replace it with Doctrine `Expr` class calls:
```php
if (!is_array($value)) {
    $queryBuilder->andWhere($queryBuilder->expr()->eq($this->getPropertyName($property), $property));
} else {
    $queryBuilder->andWhere($queryBuilder->expr()->in($this->getPropertyName($property), array($property)));
}