Switched from parent type hard-coded FQCN to ::class keyword.

This commit is contained in:
Samuele Lilli 2021-01-08 08:54:08 +01:00 committed by DonCallisto
parent 3ee310f20a
commit ff13967545
3 changed files with 6 additions and 3 deletions

View File

@ -22,6 +22,7 @@ use Symfony\Bridge\Doctrine\Form\EventListener\MergeDoctrineCollectionListener;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator; use Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator;
use Symfony\Component\Form\Exception\RuntimeException; use Symfony\Component\Form\Exception\RuntimeException;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -274,7 +275,7 @@ abstract class DoctrineType extends AbstractType implements ResetInterface
public function getParent() public function getParent()
{ {
return 'Symfony\Component\Form\Extension\Core\Type\ChoiceType'; return ChoiceType::class;
} }
public function reset() public function reset()

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Form; namespace Symfony\Component\Form;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Util\StringUtil; use Symfony\Component\Form\Util\StringUtil;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -60,6 +61,6 @@ abstract class AbstractType implements FormTypeInterface
*/ */
public function getParent() public function getParent()
{ {
return 'Symfony\Component\Form\Extension\Core\Type\FormType'; return FormType::class;
} }
} }

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Form\Tests\Fixtures; namespace Symfony\Component\Form\Tests\Fixtures;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
/** /**
@ -38,6 +39,6 @@ class ChoiceSubType extends AbstractType
*/ */
public function getParent(): ?string public function getParent(): ?string
{ {
return 'Symfony\Component\Form\Extension\Core\Type\ChoiceType'; return ChoiceType::class;
} }
} }