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