Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices::__construct PHP Method

__construct() public method

Constructor
public __construct ( array $userProviders, string $key, string $providerKey, array $options = [], Symfony\Component\HttpKernel\Log\LoggerInterface $logger = null )
$userProviders array
$key string
$providerKey string
$options array
$logger Symfony\Component\HttpKernel\Log\LoggerInterface
    public function __construct(array $userProviders, $key, $providerKey, array $options = array(), LoggerInterface $logger = null)
    {
        if (empty($key)) {
            throw new \InvalidArgumentException('$key must not be empty.');
        }
        if (empty($providerKey)) {
            throw new \InvalidArgumentException('$providerKey must not be empty.');
        }
        if (0 === count($userProviders)) {
            throw new \InvalidArgumentException('You must provide at least one user provider.');
        }

        $this->userProviders = $userProviders;
        $this->key = $key;
        $this->providerKey = $providerKey;
        $this->options = $options;
        $this->logger = $logger;
    }

Usage Example

 /**
  * Constructor.
  *
  * Note: The $secureRandom parameter is deprecated since version 2.8 and will be removed in 3.0.
  *
  * @param array                 $userProviders
  * @param string                $secret
  * @param string                $providerKey
  * @param array                 $options
  * @param LoggerInterface       $logger
  * @param SecureRandomInterface $secureRandom
  */
 public function __construct(array $userProviders, $secret, $providerKey, array $options = array(), LoggerInterface $logger = null, SecureRandomInterface $secureRandom = null)
 {
     if (null !== $secureRandom) {
         @trigger_error('The $secureRandom parameter in ' . __METHOD__ . ' is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
     }
     parent::__construct($userProviders, $secret, $providerKey, $options, $logger);
 }
All Usage Examples Of Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices::__construct