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

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. /**
  5.  * @deprecated tag:v6.5.0 - Use route defaults with "_route_scope". Example: @Route(defaults={"_route_scope"={"storefront"})
  6.  * @Annotation
  7.  *
  8.  * @Attributes({
  9.  *   @Attribute("scopes",  type = "array"),
  10.  * })
  11.  */
  12. class RouteScope extends ConfigurationAnnotation
  13. {
  14.     /**
  15.      * @var array
  16.      */
  17.     private $scopes;
  18.     /**
  19.      * @return string
  20.      */
  21.     public function getAliasName()
  22.     {
  23.         return 'routeScope';
  24.     }
  25.     /**
  26.      * @return bool
  27.      */
  28.     public function allowArray()
  29.     {
  30.         return false;
  31.     }
  32.     public function getScopes(): array
  33.     {
  34.         return $this->scopes;
  35.     }
  36.     public function setScopes(array $scopes): void
  37.     {
  38.         $this->scopes $scopes;
  39.     }
  40.     public function hasScope(string $scopeName): bool
  41.     {
  42.         return \in_array($scopeName$this->scopestrue);
  43.     }
  44. }