Skip to content

Commit 0b89ae1

Browse files
committed
[DoctrineBridge] Remove unnecassary check
1 parent e24fcce commit 0b89ae1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Form/DoctrineOrmTypeGuesser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function guessRequired(string $class, string $property): ?ValueGuess
125125
public function guessMaxLength(string $class, string $property): ?ValueGuess
126126
{
127127
$ret = $this->getMetadata($class);
128-
if ($ret && isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) {
128+
if ($ret && isset($ret[0]->fieldMappings[$property])) {
129129
$mapping = $ret[0]->getFieldMapping($property);
130130

131131
$length = $mapping instanceof FieldMapping ? $mapping->length : ($mapping['length'] ?? null);
@@ -145,7 +145,7 @@ public function guessMaxLength(string $class, string $property): ?ValueGuess
145145
public function guessPattern(string $class, string $property): ?ValueGuess
146146
{
147147
$ret = $this->getMetadata($class);
148-
if ($ret && isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) {
148+
if ($ret && isset($ret[0]->fieldMappings[$property])) {
149149
if (\in_array($ret[0]->getTypeOfField($property), [Types::DECIMAL, Types::FLOAT], true)) {
150150
return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
151151
}

0 commit comments

Comments
 (0)