src/AuthenticationService.php
public function setEvent(EventInterface $event)
    {
        $target = $this;

        if (!($event instanceof AuthenticationEvent)) {
            $eventParams = $event->getParams();
            $eventTarget = $event->getTarget();

            if ($eventTarget) {
                $target = $eventTarget;
            }

            $event = new AuthenticationEvent();

            $event->setParams($eventParams);
        }

        $event->setIdentity(null)->setTarget($target);

        $this->event = $event;

        return $this;
    }
public function setEvent(EventInterface $event)
    {
        $target = $this;

        if (!($event instanceof AuthenticationEvent)) {
            $eventParams = $event->getParams();
            $eventTarget = $event->getTarget();

            if ($eventTarget) {
                $target = $eventTarget;
            }

            $event = new AuthenticationEvent();

            $event->setParams($eventParams);
        }

        $event->setIdentity(null)->setTarget($target);

        $this->event = $event;

        return $this;
    }
public function setEvent ( EventInterface $ event ) { $ target = $ this ; if ( ! ( $ event instanceof AuthenticationEvent ) ) { $ eventParams = $ event -> getParams ( ) ; $ eventTarget = $ event -> getTarget ( ) ; if ( $ eventTarget ) { $ target = $ eventTarget ; } $ event = new AuthenticationEvent ( ) ; $ event -> setParams ( $ eventParams ) ; } $ event -> setIdentity ( null ) -> setTarget ( $ target ) ; $ this -> event = $ event ; return $ this ; }
Set an event to use during dispatch.
By default, will re-cast to AdapterChainEvent if another event type is provided.

@param EventInterface $event

@return $this
@throws \Zend\EventManager\Exception\InvalidArgumentException
Set an event to use during dispatch . By default will re - cast to AdapterChainEvent if another event type is provided .