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

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