Skip to content

Commit e0605ec

Browse files
committed
Use ::class instead of FQCN
1 parent 5de42fe commit e0605ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Form/DoctrineOrmTypeGuesser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Doctrine\Persistence\ManagerRegistry;
1818
use Doctrine\Persistence\Mapping\MappingException;
1919
use Doctrine\Persistence\Proxy;
20+
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
2021
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
2122
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
2223
use Symfony\Component\Form\Extension\Core\Type\DateIntervalType;
@@ -49,7 +50,7 @@ public function __construct(ManagerRegistry $registry)
4950
public function guessType(string $class, string $property): ?TypeGuess
5051
{
5152
if (!$ret = $this->getMetadata($class)) {
52-
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\TextType', [], Guess::LOW_CONFIDENCE);
53+
return new TypeGuess(TextType::class, [], Guess::LOW_CONFIDENCE);
5354
}
5455

5556
[$metadata, $name] = $ret;
@@ -58,7 +59,7 @@ public function guessType(string $class, string $property): ?TypeGuess
5859
$multiple = $metadata->isCollectionValuedAssociation($property);
5960
$mapping = $metadata->getAssociationMapping($property);
6061

61-
return new TypeGuess('Symfony\Bridge\Doctrine\Form\Type\EntityType', ['em' => $name, 'class' => $mapping['targetEntity'], 'multiple' => $multiple], Guess::HIGH_CONFIDENCE);
62+
return new TypeGuess(EntityType::class, ['em' => $name, 'class' => $mapping['targetEntity'], 'multiple' => $multiple], Guess::HIGH_CONFIDENCE);
6263
}
6364

6465
return match ($metadata->getTypeOfField($property)) {

0 commit comments

Comments
 (0)