protected function parseCommand($line)
    {
        $this->log('<- ' . $line . PHP_EOL, self::VERBOSITY_ALL);

        $parts = explode(' ', $line, 2);

        $command = $parts[0];

        if (count($parts) === 2) {
            $data = $parts[1];
        } else {
            $data = null;
        }

        switch ($command) {
        case 'SETDESC':
            return $this->sendSetDescription($data);

        case 'MESSAGE':
            return $this->sendMessage();

        case 'CONFIRM':
            return $this->sendConfirm();

        case 'GETINFO':
            return $this->sendGetInfo($data);

        case 'GETPIN':
            return $this->sendGetPin($data);

        case 'RESET':
            return $this->sendReset();

        case 'BYE':
            return $this->sendBye();

        default:
            return $this->sendNotImplementedOK();
        }
    }
protected function parseCommand($line)
    {
        $this->log('<- ' . $line . PHP_EOL, self::VERBOSITY_ALL);

        $parts = explode(' ', $line, 2);

        $command = $parts[0];

        if (count($parts) === 2) {
            $data = $parts[1];
        } else {
            $data = null;
        }

        switch ($command) {
        case 'SETDESC':
            return $this->sendSetDescription($data);

        case 'MESSAGE':
            return $this->sendMessage();

        case 'CONFIRM':
            return $this->sendConfirm();

        case 'GETINFO':
            return $this->sendGetInfo($data);

        case 'GETPIN':
            return $this->sendGetPin($data);

        case 'RESET':
            return $this->sendReset();

        case 'BYE':
            return $this->sendBye();

        default:
            return $this->sendNotImplementedOK();
        }
    }
protected function parseCommand ( $ line ) { $ this -> log ( '<- ' . $ line . PHP_EOL , self :: VERBOSITY_ALL ) ; $ parts = explode ( ' ' , $ line , 2 ) ; $ command = $ parts [ 0 ] ; if ( count ( $ parts ) === 2 ) { $ data = $ parts [ 1 ] ; } else { $ data = null ; } switch ( $ command ) { case 'SETDESC' : return $ this -> sendSetDescription ( $ data ) ; case 'MESSAGE' : return $ this -> sendMessage ( ) ; case 'CONFIRM' : return $ this -> sendConfirm ( ) ; case 'GETINFO' : return $ this -> sendGetInfo ( $ data ) ; case 'GETPIN' : return $ this -> sendGetPin ( $ data ) ; case 'RESET' : return $ this -> sendReset ( ) ; case 'BYE' : return $ this -> sendBye ( ) ; default : return $ this -> sendNotImplementedOK ( ) ; } }
Parses an assuan command and performs the appropriate action

Documentation of the assuan commands for pinentry is limited to
non-existent. Most of these commands were taken from the C source code
to gpg-agent and pinentry.

Additional context was provided by using strace -f when calling the
gpg-agent.

@param string $line the assuan command line to parse

@return Crypt_GPG_PinEntry the current object, for fluent interface.
Parses an assuan command and performs the appropriate action