Skip to content

Commit 51ea5a9

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: Add `TEST_GENERATE_FIXTURES=1` to generate fixtures in tests [Config] Fix array shape for `canBeEnabled` / `canBeDisabled` [DoctrineBridge] Remove unnecassary check [JsonStreamer] Add synthetic properties support Resolved Conflicts: - src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php - src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php - src/Symfony/Component/JsonStreamer/Tests/JsonStreamReaderTest.php
2 parents 3097c7b + 0b89ae1 commit 51ea5a9

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
@@ -124,7 +124,7 @@ public function guessRequired(string $class, string $property): ?ValueGuess
124124
public function guessMaxLength(string $class, string $property): ?ValueGuess
125125
{
126126
$ret = $this->getMetadata($class);
127-
if ($ret && isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) {
127+
if ($ret && isset($ret[0]->fieldMappings[$property])) {
128128
$mapping = $ret[0]->getFieldMapping($property);
129129

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

0 commit comments

Comments
 (0)