/**
  * Construct the validation chain
  *
  * Retrieves validators from session storage and attaches them.
  *
  * Duplicated in ValidatorChainEM3 to prevent trait collision with parent.
  *
  * @param StorageInterface $storage
  */
 public function __construct(StorageInterface $storage)
 {
     parent::__construct();
     $this->storage = $storage;
     $validators = $storage->getMetadata('_VALID');
     if ($validators) {
         foreach ($validators as $validator => $data) {
             $this->attachValidator('session.validate', [new $validator($data), 'isValid'], 1);
         }
     }
 }
Beispiel #2
0
 /**
  * UserEventManager constructor.
  *
  * @param array|int|null|string|\Traversable $identifiers
  * @param ListenerCollection                 $listeners
  */
 public function __construct($identifiers, ListenerCollection $listeners)
 {
     $this->listeners = $listeners;
     parent::__construct($identifiers);
 }