MetadataFactoryInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\Validator\Mapping\Factory;
  11. use Symfony\Component\Validator\Exception\NoSuchMetadataException;
  12. use Symfony\Component\Validator\Mapping\MetadataInterface;
  13. /**
  14. * Returns {@link \Symfony\Component\Validator\Mapping\MetadataInterface} instances for values.
  15. *
  16. * @author Bernhard Schussek <bschussek@gmail.com>
  17. */
  18. interface MetadataFactoryInterface
  19. {
  20. /**
  21. * Returns the metadata for the given value.
  22. *
  23. * @param mixed $value Some value
  24. *
  25. * @return MetadataInterface The metadata for the value
  26. *
  27. * @throws NoSuchMetadataException If no metadata exists for the given value
  28. */
  29. public function getMetadataFor($value);
  30. /**
  31. * Returns whether the class is able to return metadata for the given value.
  32. *
  33. * @param mixed $value Some value
  34. *
  35. * @return bool Whether metadata can be returned for that value
  36. */
  37. public function hasMetadataFor($value);
  38. }