custom/plugins/SwagPlatformSecurity/src/Components/State.php line 5

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Swag\Security\Components;
  3. class State
  4. {
  5.     public const CONFIG_PREFIX 'SwagPlatformSecurity.config.';
  6.     /**
  7.      * @var AbstractSecurityFix[]
  8.      */
  9.     public const KNOWN_ISSUES = [
  10.         \Swag\Security\Fixes\NEXT9241\SecurityFix::class,
  11.         \Swag\Security\Fixes\NEXT9240\SecurityFix::class,
  12.         \Swag\Security\Fixes\NEXT9175\SecurityFix::class,
  13.         \Swag\Security\Fixes\NEXT9242\SecurityFix::class,
  14.         \Swag\Security\Fixes\NEXT9243\SecurityFix::class,
  15.         \Swag\Security\Fixes\NEXT9569\SecurityFix::class,
  16.         \Swag\Security\Fixes\NEXT10624\SecurityFix::class,
  17.         \Swag\Security\Fixes\NEXT10909\SecurityFix::class,
  18.         \Swag\Security\Fixes\NEXT10905\SecurityFix::class,
  19.         \Swag\Security\Fixes\NEXT12230\SecurityFix::class,
  20.         \Swag\Security\Fixes\NEXT9689\SecurityFix::class,
  21.         \Swag\Security\Fixes\NEXT12359\SecurityFix::class,
  22.         \Swag\Security\Fixes\NEXT13371\SecurityFix::class,
  23.         \Swag\Security\Fixes\NEXT13247\SecurityFix::class,
  24.         \Swag\Security\Fixes\NEXT12824\SecurityFix::class,
  25.         \Swag\Security\Fixes\NEXT13664\SecurityFix::class,
  26.         \Swag\Security\Fixes\NEXT13896\SecurityFix::class,
  27.         \Swag\Security\Fixes\NEXT14482\SecurityFix::class,
  28.         \Swag\Security\Fixes\NEXT14533\SecurityFix::class,
  29.         \Swag\Security\Fixes\NEXT15183\SecurityFix::class,
  30.         \Swag\Security\Fixes\NEXT14744\SecurityFix::class,
  31.         \Swag\Security\Fixes\NEXT14871\SecurityFix::class,
  32.         \Swag\Security\Fixes\NEXT14883\SecurityFix::class,
  33.         \Swag\Security\Fixes\NEXT15669\SecurityFix::class,
  34.         \Swag\Security\Fixes\NEXT15673\SecurityFix::class,
  35.         \Swag\Security\Fixes\NEXT15681\SecurityFix::class,
  36.         \Swag\Security\Fixes\NEXT16429\SecurityFix::class,
  37.         \Swag\Security\Fixes\NEXT15675\SecurityFix::class,
  38.         \Swag\Security\Fixes\NEXT17527\SecurityFix::class,
  39.         \Swag\Security\Fixes\NEXT19276\SecurityFix::class,
  40.         \Swag\Security\Fixes\NEXT19820\SecurityFix::class,
  41.         \Swag\Security\Fixes\NEXT20309\SecurityFix::class,
  42.         \Swag\Security\Fixes\NEXT20348\SecurityFix::class,
  43.         \Swag\Security\Fixes\NEXT20305\SecurityFix::class,
  44.         \Swag\Security\Fixes\NEXT21078\SecurityFix::class,
  45.         \Swag\Security\Fixes\NEXT21034\SecurityFix::class,
  46.         \Swag\Security\Fixes\NEXT23325\SecurityFix::class,
  47.         \Swag\Security\Fixes\NEXT23464\SecurityFix::class,
  48.         \Swag\Security\Fixes\NEXT23562\SecurityFix::class,
  49.         \Swag\Security\Fixes\NEXT22891\SecurityFix::class,
  50.         \Swag\Security\Fixes\NEXT24667\SecurityFix::class,
  51.         \Swag\Security\Fixes\NEXT24679\SecurityFix::class,
  52.         \Swag\Security\Fixes\PPI737\SecurityFix::class,
  53.         \Swag\Security\Fixes\NEXT26140\SecurityFix::class,
  54.     ];
  55.     /**
  56.      * @var AbstractSecurityFix[]
  57.      */
  58.     private $activeFixes;
  59.     /**
  60.      * @var AbstractSecurityFix[]
  61.      */
  62.     private $availableFixes;
  63.     public function __construct(array $availableFixes, array $activeFixes)
  64.     {
  65.         $this->availableFixes $availableFixes;
  66.         $this->activeFixes $activeFixes;
  67.     }
  68.     public function getActiveFixes(): array
  69.     {
  70.         return $this->activeFixes;
  71.     }
  72.     public function getAvailableFixes(): array
  73.     {
  74.         return $this->availableFixes;
  75.     }
  76.     public function isActive(string $ticket): bool
  77.     {
  78.         foreach ($this->getActiveFixes() as $validFix) {
  79.             if ($validFix::getTicket() === $ticket) {
  80.                 return true;
  81.             }
  82.         }
  83.         return false;
  84.     }
  85. }