UrlMatcherInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\Routing\Matcher;
  11. use Symfony\Component\Routing\RequestContextAwareInterface;
  12. use Symfony\Component\Routing\Exception\ResourceNotFoundException;
  13. use Symfony\Component\Routing\Exception\MethodNotAllowedException;
  14. /**
  15. * UrlMatcherInterface is the interface that all URL matcher classes must implement.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. *
  19. * @api
  20. */
  21. interface UrlMatcherInterface extends RequestContextAwareInterface
  22. {
  23. /**
  24. * Tries to match a URL path with a set of routes.
  25. *
  26. * If the matcher can not find information, it must throw one of the exceptions documented
  27. * below.
  28. *
  29. * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded)
  30. *
  31. * @return array An array of parameters
  32. *
  33. * @throws ResourceNotFoundException If the resource could not be found
  34. * @throws MethodNotAllowedException If the resource was found but the request method is not allowed
  35. *
  36. * @api
  37. */
  38. public function match($pathinfo);
  39. }