src/AnnotationGenerator/ConstraintAnnotationGenerator.php
public function generateClassAnnotations(string $className): array
    {
        if ($this->classes[$className]['isEnum']) {
            return [];
        }

        $annotation = [];
        $uniqueFields = [];

        foreach ($this->classes[$className]['fields'] as $field) {
            if (false === $field['isUnique']) {
                continue;
            }

            $uniqueFields[] = $field['name'];
        }

        if (!$uniqueFields) {
            return [];
        }

        if (1 === count($uniqueFields)) {
            $annotation[] = sprintf('@UniqueEntity("%s")', $uniqueFields[0]);
        } else {
            $annotation[] = sprintf('@UniqueEntity(fields={"%s"})', implode('","', $uniqueFields));
        }

        return $annotation;
    }
public function generateClassAnnotations(string $className): array
    {
        if ($this->classes[$className]['isEnum']) {
            return [];
        }

        $annotation = [];
        $uniqueFields = [];

        foreach ($this->classes[$className]['fields'] as $field) {
            if (false === $field['isUnique']) {
                continue;
            }

            $uniqueFields[] = $field['name'];
        }

        if (!$uniqueFields) {
            return [];
        }

        if (1 === count($uniqueFields)) {
            $annotation[] = sprintf('@UniqueEntity("%s")', $uniqueFields[0]);
        } else {
            $annotation[] = sprintf('@UniqueEntity(fields={"%s"})', implode('","', $uniqueFields));
        }

        return $annotation;
    }
{@inheritdoc}