FirewallContext.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bundle\SecurityBundle\Security;
  11. use Symfony\Component\Security\Http\Firewall\ExceptionListener;
  12. use Symfony\Component\Security\Http\Firewall\LogoutListener;
  13. /**
  14. * This is a wrapper around the actual firewall configuration which allows us
  15. * to lazy load the context for one specific firewall only when we need it.
  16. *
  17. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  18. */
  19. class FirewallContext
  20. {
  21. private $listeners;
  22. private $exceptionListener;
  23. private $logoutListener;
  24. private $config;
  25. public function __construct(iterable $listeners, ExceptionListener $exceptionListener = null, LogoutListener $logoutListener = null, FirewallConfig $config = null)
  26. {
  27. $this->listeners = $listeners;
  28. $this->exceptionListener = $exceptionListener;
  29. $this->logoutListener = $logoutListener;
  30. $this->config = $config;
  31. }
  32. public function getConfig()
  33. {
  34. return $this->config;
  35. }
  36. public function getListeners(): iterable
  37. {
  38. return $this->listeners;
  39. }
  40. public function getExceptionListener()
  41. {
  42. return $this->exceptionListener;
  43. }
  44. public function getLogoutListener()
  45. {
  46. return $this->logoutListener;
  47. }
  48. }