Skip to content

Commit 3d02781

Browse files
committed
Fix CS
1 parent fd16d7d commit 3d02781

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Symfony/Bridge/Doctrine/Validator/DoctrineLoader.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Doctrine\ORM\Mapping\ClassMetadataFactory;
1616
use Doctrine\ORM\Mapping\ClassMetadataInfo;
1717
use Doctrine\ORM\Mapping\MappingException as OrmMappingException;
18-
1918
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
2019
use Symfony\Component\Validator\Constraints\Length;
2120
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -70,7 +69,7 @@ public function loadClassMetadata(ClassMetadata $metadata): bool
7069
foreach ($doctrineMetadata->fieldMappings as $mapping) {
7170
// TODO: Currently, I don't add a constraint if one of the same type already exists, but it's maybe safer to add both (min/max)?
7271
if (null !== $mapping['length'] && !$this->propertyHasConstraint($metadata, Length::class, $mapping['fieldName'])) {
73-
$metadata->addPropertyConstraint($mapping['fieldName'], new Length(['max' => $mapping['length']]));
72+
$metadata->addPropertyConstraint($mapping['fieldName'], new Length(array('max' => $mapping['length'])));
7473
}
7574

7675
// TODO: handle autogenerated identifiers that definitely can be null

src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
7070
}
7171

7272
if (!$this->propertyHasConstraint($metadata, Type::class, $property)) {
73-
if (1 === \count($builtinTypes)) {
73+
if (1 === \count($builtinTypes)) {
7474
$metadata->addPropertyConstraint($property, new Type(array('type' => $builtinTypes[0])));
7575
} elseif ($scalar) {
7676
$metadata->addPropertyConstraint($property, new Type(array('type' => 'scalar')));

0 commit comments

Comments
 (0)