FirewallContext.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. public function __construct(array $listeners, ExceptionListener $exceptionListener = null, LogoutListener $logoutListener = null)
  25. {
  26. $this->listeners = $listeners;
  27. $this->exceptionListener = $exceptionListener;
  28. $this->logoutListener = $logoutListener;
  29. }
  30. public function getContext()
  31. {
  32. return array($this->listeners, $this->exceptionListener, $this->logoutListener);
  33. }
  34. }