protected function badPassException($code, $message)
    {
        $badPassphrases = array_diff_key(
            isset($this->data['BadPassphrases']) ? $this->data['BadPassphrases'] : array(),
            isset($this->data['MissingPassphrases']) ? $this->data['MissingPassphrases'] : array()
        );

        $missingPassphrases = array_intersect_key(
            isset($this->data['BadPassphrases']) ? $this->data['BadPassphrases'] : array(),
            isset($this->data['MissingPassphrases']) ? $this->data['MissingPassphrases'] : array()
        );

        if (count($badPassphrases) > 0) {
            $message .= ' Incorrect passphrase provided for keys: "' .
                implode('", "', $badPassphrases) . '".';
        }
        if (count($missingPassphrases) > 0) {
            $message .= ' No passphrase provided for keys: "' .
                implode('", "', $missingPassphrases) . '".';
        }

        return new Crypt_GPG_BadPassphraseException(
            $message,
            $code,
            $badPassphrases,
            $missingPassphrases
        );
    }
protected function badPassException($code, $message)
    {
        $badPassphrases = array_diff_key(
            isset($this->data['BadPassphrases']) ? $this->data['BadPassphrases'] : array(),
            isset($this->data['MissingPassphrases']) ? $this->data['MissingPassphrases'] : array()
        );

        $missingPassphrases = array_intersect_key(
            isset($this->data['BadPassphrases']) ? $this->data['BadPassphrases'] : array(),
            isset($this->data['MissingPassphrases']) ? $this->data['MissingPassphrases'] : array()
        );

        if (count($badPassphrases) > 0) {
            $message .= ' Incorrect passphrase provided for keys: "' .
                implode('", "', $badPassphrases) . '".';
        }
        if (count($missingPassphrases) > 0) {
            $message .= ' No passphrase provided for keys: "' .
                implode('", "', $missingPassphrases) . '".';
        }

        return new Crypt_GPG_BadPassphraseException(
            $message,
            $code,
            $badPassphrases,
            $missingPassphrases
        );
    }
protected function badPassException ( $ code , $ message ) { $ badPassphrases = array_diff_key ( isset ( $ this -> data [ 'BadPassphrases' ] ) ? $ this -> data [ 'BadPassphrases' ] : array ( ) , isset ( $ this -> data [ 'MissingPassphrases' ] ) ? $ this -> data [ 'MissingPassphrases' ] : array ( ) ) ; $ missingPassphrases = array_intersect_key ( isset ( $ this -> data [ 'BadPassphrases' ] ) ? $ this -> data [ 'BadPassphrases' ] : array ( ) , isset ( $ this -> data [ 'MissingPassphrases' ] ) ? $ this -> data [ 'MissingPassphrases' ] : array ( ) ) ; if ( count ( $ badPassphrases ) > 0 ) { $ message .= ' Incorrect passphrase provided for keys: "' . implode ( '", "' , $ badPassphrases ) . '".' ; } if ( count ( $ missingPassphrases ) > 0 ) { $ message .= ' No passphrase provided for keys: "' . implode ( '", "' , $ missingPassphrases ) . '".' ; } return new Crypt_GPG_BadPassphraseException ( $ message , $ code , $ badPassphrases , $ missingPassphrases ) ; }
Create Crypt_GPG_BadPassphraseException from operation data.

@param int    $code    Error code
@param string $message Error message

@return Crypt_GPG_BadPassphraseException
Create Crypt_GPG_BadPassphraseException from operation data .