public function setSender(ContactInterface $sender = null)
    {
        if ($sender !== null && !($sender instanceof Contact)) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s expects an instance of %s.',
                    __FUNCTION__, Contact::class
                )
            );
        }
        $this->sender = $sender;

        return $this;
    }
public function setSender(ContactInterface $sender = null)
    {
        if ($sender !== null && !($sender instanceof Contact)) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s expects an instance of %s.',
                    __FUNCTION__, Contact::class
                )
            );
        }
        $this->sender = $sender;

        return $this;
    }
public function setSender ( ContactInterface $ sender = null ) { if ( $ sender !== null && ! ( $ sender instanceof Contact ) ) { throw new InvalidArgumentException ( sprintf ( '%s expects an instance of %s.' , __FUNCTION__ , Contact :: class ) ) ; } $ this -> sender = $ sender ; return $ this ; }
Sets the sender.
Optional OR Required. Optional where From is one person. Required where From is multiple people.

@param Contact|null $sender

@throws InvalidArgumentException
@return static
Sets the sender . Optional OR Required . Optional where From is one person . Required where From is multiple people .