LoaderInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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\Config\Loader;
  11. /**
  12. * LoaderInterface is the interface implemented by all loader classes.
  13. *
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface LoaderInterface
  17. {
  18. /**
  19. * Loads a resource.
  20. *
  21. * @param mixed $resource The resource
  22. * @param string|null $type The resource type or null if unknown
  23. *
  24. * @return mixed
  25. *
  26. * @throws \Exception If something went wrong
  27. */
  28. public function load($resource, $type = null);
  29. /**
  30. * Returns whether this class supports the given resource.
  31. *
  32. * @param mixed $resource A resource
  33. * @param string|null $type The resource type or null if unknown
  34. *
  35. * @return bool True if this class supports the given resource, false otherwise
  36. */
  37. public function supports($resource, $type = null);
  38. /**
  39. * Gets the loader resolver.
  40. *
  41. * @return LoaderResolverInterface A LoaderResolverInterface instance
  42. */
  43. public function getResolver();
  44. /**
  45. * Sets the loader resolver.
  46. */
  47. public function setResolver(LoaderResolverInterface $resolver);
  48. }