vendor/shopware/core/Framework/Routing/Annotation/RouteScope.php line 16

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Routing\Annotation;
  3. use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationAnnotation;
  4. use Shopware\Core\Framework\Feature;
  5. /**
  6.  * @deprecated tag:v6.5.0 - Use route defaults with "_routeScope". Example: @Route(defaults={"_routeScope"={"storefront"}})
  7.  * @Annotation
  8.  *
  9.  * @Attributes({
  10.  *   @Attribute("scopes",  type = "array"),
  11.  * })
  12.  */
  13. class RouteScope extends ConfigurationAnnotation
  14. {
  15.     /**
  16.      * @var array
  17.      */
  18.     private $scopes;
  19.     /**
  20.      * @return string
  21.      */
  22.     public function getAliasName()
  23.     {
  24.         Feature::triggerDeprecationOrThrow(
  25.             'v6.5.0.0',
  26.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''"@Route(defaults={"_routeScope"={"storefront"}})"')
  27.         );
  28.         return 'routeScope';
  29.     }
  30.     /**
  31.      * @return bool
  32.      */
  33.     public function allowArray()
  34.     {
  35.         Feature::triggerDeprecationOrThrow(
  36.             'v6.5.0.0',
  37.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''"@Route(defaults={"_routeScope"={"storefront"}})"')
  38.         );
  39.         return false;
  40.     }
  41.     public function getScopes(): array
  42.     {
  43.         Feature::triggerDeprecationOrThrow(
  44.             'v6.5.0.0',
  45.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''"@Route(defaults={"_routeScope"={"storefront"}})"')
  46.         );
  47.         return $this->scopes;
  48.     }
  49.     public function setScopes(array $scopes): void
  50.     {
  51.         Feature::triggerDeprecationOrThrow(
  52.             'v6.5.0.0',
  53.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''"@Route(defaults={"_routeScope"={"storefront"}})"')
  54.         );
  55.         $this->scopes $scopes;
  56.     }
  57.     public function hasScope(string $scopeName): bool
  58.     {
  59.         Feature::triggerDeprecationOrThrow(
  60.             'v6.5.0.0',
  61.             Feature::deprecatedClassMessage(__CLASS__'v6.5.0.0''"@Route(defaults={"_routeScope"={"storefront"}})"')
  62.         );
  63.         return \in_array($scopeName$this->scopestrue);
  64.     }
  65. }