UrlMatcherInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. interface UrlMatcherInterface extends RequestContextAwareInterface
  20. {
  21. /**
  22. * Tries to match a URL path with a set of routes.
  23. *
  24. * If the matcher can not find information, it must throw one of the exceptions documented
  25. * below.
  26. *
  27. * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded)
  28. *
  29. * @return array An array of parameters
  30. *
  31. * @throws ResourceNotFoundException If the resource could not be found
  32. * @throws MethodNotAllowedException If the resource was found but the request method is not allowed
  33. */
  34. public function match($pathinfo);
  35. }