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.     /** @var array */
  14.     private $scopes;
  15.     public function getAliasName()
  16.     {
  17.         return 'routeScope';
  18.     }
  19.     public function allowArray()
  20.     {
  21.         return false;
  22.     }
  23.     public function getScopes(): array
  24.     {
  25.         return $this->scopes;
  26.     }
  27.     public function setScopes(array $scopes): void
  28.     {
  29.         $this->scopes $scopes;
  30.     }
  31.     public function hasScope(string $scopeName): bool
  32.     {
  33.         return in_array($scopeName$this->scopestrue);
  34.     }
  35. }