/**
  * @return DebugModule
  */
 public function handleResponseReadyData()
 {
     $result = $this;
     if (!$this->getIsEnabled()) {
         return $result;
     }
     $rpc = $this->getRpc();
     $response = $rpc->getResponse();
     $readyData = $response->getReadyData();
     // readyData.debug
     if (!$this->getIsDebugEnabled()) {
         $response->unsetReadyDataKey('debug');
     } else {
         $readyDataDebug = $response->getReadyDataKey('debug');
         $readyDataDebug = RpcUtil::arrayEnsure($readyDataDebug, array('demoDebugModuleMessage' => 'foo ' . __METHOD__, 'isDebugEnabled' => true, 'rpc' => array('request' => $rpc->getRequest()->getData(), 'result' => $rpc->getResponse()->getResult(), 'hasException' => $rpc->getResponse()->hasException())));
         if ($response->hasException()) {
             $readyDataDebug['errorInfo'] = RpcUtil::exceptionAsArray($response->getException(), true);
         }
         $response->setReadyDataKey('debug', $readyDataDebug);
     }
     return $result;
 }
 /**
  * @param $key
  * @return array
  */
 protected function _getModuleConfigItemByKey($key)
 {
     $result = array('config' => null, 'class' => null);
     $item = $this->getConfigValue($key);
     $result = RpcUtil::arrayEnsure($item, $result);
     return $result;
 }