LoaderInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. * @throws \Exception If something went wrong
  25. */
  26. public function load($resource, $type = null);
  27. /**
  28. * Returns whether this class supports the given resource.
  29. *
  30. * @param mixed $resource A resource
  31. * @param string|null $type The resource type or null if unknown
  32. *
  33. * @return bool True if this class supports the given resource, false otherwise
  34. */
  35. public function supports($resource, $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. }