Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3295c24

Browse files
author
Wojciech Kania
committed
[DoctrineBridge] Fix Coding Standards
1 parent bc58eba commit 3295c24

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function validate($object, Constraint $constraint)
8585
try {
8686
$repository = $em->getRepository($entityClass);
8787
$isEntity = true;
88-
}catch (\Exception $e) {
88+
} catch (\Exception $e) {
8989
$isEntity = false;
9090
}
9191

@@ -186,9 +186,7 @@ public function validate($object, Constraint $constraint)
186186

187187
$fieldValues = $this->getFieldValues($object, $class, $identifierFieldNames);
188188
if (array_values($class->getIdentifierFieldNames()) != array_values($identifierFieldNames)) {
189-
throw new ConstraintDefinitionException(
190-
sprintf('The "%s" entity identifier field names should be "%s", not "%s".', $constraint->entityClass, implode(', ', $class->getIdentifierFieldNames()), implode(', ', $constraint->identifierFieldNames))
191-
);
189+
throw new ConstraintDefinitionException(sprintf('The "%s" entity identifier field names should be "%s", not "%s".', $constraint->entityClass, implode(', ', $class->getIdentifierFieldNames()), implode(', ', $constraint->identifierFieldNames)));
192190
}
193191

194192
$entityMatched = true;
@@ -277,7 +275,7 @@ public function getFieldValues($object, ClassMetadata $class, array $fields, boo
277275
throw new ConstraintDefinitionException(sprintf('The field "%s" is not mapped by Doctrine, so it cannot be validated for uniqueness.', $entityFieldName));
278276
}
279277

280-
$fieldName = is_int($objectFieldName) ? $entityFieldName : $objectFieldName;
278+
$fieldName = \is_int($objectFieldName) ? $entityFieldName : $objectFieldName;
281279
if (!$isEntity) {
282280
if (!$reflectionObject->hasProperty($fieldName)) {
283281
throw new ConstraintDefinitionException(sprintf('The field "%s" is not a property of class "%s".', $fieldName, $objectClass));

0 commit comments

Comments
 (0)