FormRegistryInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Form;
  11. /**
  12. * The central registry of the Form component.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. interface FormRegistryInterface
  17. {
  18. /**
  19. * Returns a form type by name.
  20. *
  21. * This methods registers the type extensions from the form extensions.
  22. *
  23. * @return ResolvedFormTypeInterface The type
  24. *
  25. * @throws Exception\InvalidArgumentException if the type can not be retrieved from any extension
  26. */
  27. public function getType(string $name);
  28. /**
  29. * Returns whether the given form type is supported.
  30. *
  31. * @return bool Whether the type is supported
  32. */
  33. public function hasType(string $name);
  34. /**
  35. * Returns the guesser responsible for guessing types.
  36. *
  37. * @return FormTypeGuesserInterface|null
  38. */
  39. public function getTypeGuesser();
  40. /**
  41. * Returns the extensions loaded by the framework.
  42. *
  43. * @return FormExtensionInterface[]
  44. */
  45. public function getExtensions();
  46. }