Drupal investigation

RouteEnhancerInterface.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Symfony CMF package.
  4. *
  5. * (c) 2011-2015 Symfony CMF
  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\Cmf\Component\Routing\Enhancer;
  11. use Symfony\Component\HttpFoundation\Request;
  12. /**
  13. * A route enhancer can change the values in the route data arrays.
  14. *
  15. * This is useful to provide information to the rest of the routing system
  16. * that can be inferred from other parameters rather than hardcode that
  17. * information in every route.
  18. *
  19. * @author David Buchmann
  20. */
  21. interface RouteEnhancerInterface
  22. {
  23. /**
  24. * Update the defaults based on its own data and the request.
  25. *
  26. * @param array $defaults the getRouteDefaults array.
  27. * @param Request $request the Request instance.
  28. *
  29. * @return array the modified defaults. Each enhancer MUST return the
  30. * $defaults but may add or remove values.
  31. */
  32. public function enhance(array $defaults, Request $request);
  33. }