Swift_Message::detachSigner PHP Method

detachSigner() public method

Attach a new signature handler to the message.
public detachSigner ( Swift_Signer $signer ) : Swift_Message
$signer Swift_Signer
return Swift_Message
    public function detachSigner(Swift_Signer $signer)
    {
        if ($signer instanceof Swift_Signers_HeaderSigner) {
            foreach ($this->headerSigners as $k => $headerSigner) {
                if ($headerSigner === $signer) {
                    unset($this->headerSigners[$k]);
                    return $this;
                }
            }
        } elseif ($signer instanceof Swift_Signers_BodySigner) {
            foreach ($this->bodySigners as $k => $bodySigner) {
                if ($bodySigner === $signer) {
                    unset($this->bodySigners[$k]);
                    return $this;
                }
            }
        }
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  *
  * @return $this|self
  */
 public function detachSigner(\Swift_Signer $signer) : self
 {
     return $this->message->detachSigner($signer);
 }