vendor/sensio/framework-extra-bundle/src/Configuration/Route.php line 16

Open in your IDE?
  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 Sensio\Bundle\FrameworkExtraBundle\Configuration;
  11. use Symfony\Component\Routing\Annotation\Route as BaseRoute;
  12. @trigger_error(sprintf('The "%s" annotation is deprecated since version 5.2. Use "%s" instead.', Route::class, BaseRoute::class), \E_USER_DEPRECATED);
  13. /**
  14. * @author Kris Wallsmith <kris@symfony.com>
  15. * @Annotation
  16. *
  17. * @deprecated since version 5.2
  18. */
  19. class Route extends BaseRoute
  20. {
  21. private $service;
  22. public function setService($service)
  23. {
  24. // avoid a BC notice in case of @Route(service="") with sf ^2.7
  25. if (null === $this->getPath()) {
  26. $this->setPath('');
  27. }
  28. $this->service = $service;
  29. }
  30. public function getService()
  31. {
  32. return $this->service;
  33. }
  34. public function setLocalizedPaths(array $localizedPaths)
  35. {
  36. if (isset($localizedPaths['service'])) {
  37. $this->setService($localizedPaths['service']);
  38. unset($localizedPaths['service']);
  39. }
  40. parent::setLocalizedPaths($localizedPaths);
  41. }
  42. /**
  43. * Multiple route annotations are allowed.
  44. *
  45. * @return bool
  46. *
  47. * @see ConfigurationInterface
  48. */
  49. public function allowArray()
  50. {
  51. return true;
  52. }
  53. }