Sure? I think it must be:

```php
foreach ($value as $valueEntry) {
            if ( ! is_object($valueEntry) || ! $this->_em->getMetadataFactory()->hasMetadataFor(ClassUtils::getClass($valueEntry))) {
                $values[] = $value;
                continue;
```