src/EventSubscriber/MailerSubscriber.php
public function getUserEmail(GenericEvent $event)
    {
        $user = $event->getSubject();

        if (!$user instanceof UserInterface) {
            throw new \InvalidArgumentException('MailerSubscriber event is expected to contain an instance of User');
        }

        $this->mailAddress = $user->getEmail();
        $this->username = $user->getUsername();
    }
public function getUserEmail(GenericEvent $event)
    {
        $user = $event->getSubject();

        if (!$user instanceof UserInterface) {
            throw new \InvalidArgumentException('MailerSubscriber event is expected to contain an instance of User');
        }

        $this->mailAddress = $user->getEmail();
        $this->username = $user->getUsername();
    }
public function getUserEmail ( GenericEvent $ event ) { $ user = $ event -> getSubject ( ) ; if ( ! $ user instanceof UserInterface ) { throw new \ InvalidArgumentException ( 'MailerSubscriber event is expected to contain an instance of User' ) ; } $ this -> mailAddress = $ user -> getEmail ( ) ; $ this -> username = $ user -> getUsername ( ) ; }
Gets the username and mail address of the user to be removed.

@param GenericEvent $event
Gets the username and mail address of the user to be removed .