MetadataFactoryInterface.php 1.1 KB

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