private function executeCommand($command)
    {
        if ( !is_array($command) || !isset($command['command']) ) {
            return $this->returnError('Malformed command received.');
        }

        switch ($command['command']) {
            case 'journal': return $this->commandJournal($command);
            case 'shutdown': return $this->commandShutdown($command);
            default: return $this->returnError('Unknown command.');
        }
    }
private function executeCommand($command)
    {
        if ( !is_array($command) || !isset($command['command']) ) {
            return $this->returnError('Malformed command received.');
        }

        switch ($command['command']) {
            case 'journal': return $this->commandJournal($command);
            case 'shutdown': return $this->commandShutdown($command);
            default: return $this->returnError('Unknown command.');
        }
    }
private function executeCommand ( $ command ) { if ( ! is_array ( $ command ) || ! isset ( $ command [ 'command' ] ) ) { return $ this -> returnError ( 'Malformed command received.' ) ; } switch ( $ command [ 'command' ] ) { case 'journal' : return $ this -> commandJournal ( $ command ) ; case 'shutdown' : return $ this -> commandShutdown ( $ command ) ; default : return $ this -> returnError ( 'Unknown command.' ) ; } }
Execute the command received from the Job

@param  array $command
@return array the response
Execute the command received from the Job