LoaderInterface.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\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. *
  23. * @return mixed
  24. *
  25. * @throws \Exception If something went wrong
  26. */
  27. public function load($resource, string $type = null);
  28. /**
  29. * Returns whether this class supports the given resource.
  30. *
  31. * @param mixed $resource A resource
  32. *
  33. * @return bool True if this class supports the given resource, false otherwise
  34. */
  35. public function supports($resource, string $type = null);
  36. /**
  37. * Gets the loader resolver.
  38. *
  39. * @return LoaderResolverInterface A LoaderResolverInterface instance
  40. */
  41. public function getResolver();
  42. /**
  43. * Sets the loader resolver.
  44. */
  45. public function setResolver(LoaderResolverInterface $resolver);
  46. }