LoaderInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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\Translation\Loader;
  11. use Symfony\Component\Translation\Exception\InvalidResourceException;
  12. use Symfony\Component\Translation\Exception\NotFoundResourceException;
  13. use Symfony\Component\Translation\MessageCatalogue;
  14. /**
  15. * LoaderInterface is the interface implemented by all translation loaders.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. interface LoaderInterface
  20. {
  21. /**
  22. * Loads a locale.
  23. *
  24. * @param mixed $resource A resource
  25. * @param string $locale A locale
  26. * @param string $domain The domain
  27. *
  28. * @return MessageCatalogue A MessageCatalogue instance
  29. *
  30. * @throws NotFoundResourceException when the resource cannot be found
  31. * @throws InvalidResourceException when the resource cannot be loaded
  32. */
  33. public function load($resource, string $locale, string $domain = 'messages');
  34. }