PartKeepr\AuthBundle\Security\Authentication\AuthenticationProviderManager::__construct PHP Method

__construct() public method

Constructor.
public __construct ( array $providers, boolean $eraseCredentials = true )
$providers array An array of AuthenticationProviderInterface instances
$eraseCredentials boolean Whether to erase credentials after authentication or not
    public function __construct(array $providers, $eraseCredentials = true)
    {
        if (!$providers) {
            throw new \InvalidArgumentException('You must at least add one authentication provider.');
        }
        foreach ($providers as $provider) {
            if (!$provider instanceof AuthenticationProviderInterface) {
                throw new \InvalidArgumentException(sprintf('UserProvider "%s" must implement the AuthenticationProviderInterface.', get_class($provider)));
            }
        }
        $this->providers = $providers;
        $this->eraseCredentials = (bool) $eraseCredentials;
    }