[Minor] Refactoring to avoid duplicate code

Very merry end of the year :)
`$class = $class = $this->metadataFactory->getMetadataFor(get_class($entity))` is enough in any case. `ClassUtils::getClass()` causes more internal method calls anyway.