菜谱项目

RequestMatcherInterface.php 1.1KB

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\Routing\Matcher;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\Routing\Exception\ResourceNotFoundException;
  13. use Symfony\Component\Routing\Exception\MethodNotAllowedException;
  14. /**
  15. * RequestMatcherInterface is the interface that all request matcher classes must implement.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. interface RequestMatcherInterface
  20. {
  21. /**
  22. * Tries to match a request 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. * @return array An array of parameters
  28. *
  29. * @throws ResourceNotFoundException If no matching resource could be found
  30. * @throws MethodNotAllowedException If a matching resource was found but the request method is not allowed
  31. */
  32. public function matchRequest(Request $request);
  33. }