Exemplo n.º 1
0
 public function output(Hoa\Core\Event\Bucket $bucket)
 {
     $data = $bucket->getData();
     $line = $data['line'];
     if (empty($line)) {
         return;
     }
     if (true === $this->_glutton) {
         if ("" === $line) {
             $this->keyframe();
             return;
         }
         $this->_diff .= $line . "\n";
         return;
     }
     if ('+++' === substr($line, 0, 3)) {
         $this->_glutton = true;
         return;
     }
     if (':' === $line[0]) {
         list(, $this->_filename, , ) = explode("", $line);
         if (!isset($this->_editors[$this->_filename])) {
             while (false == ($id = $this->_readline->readLine('(id#' . $this->_filename . ') > '))) {
             }
             $this->_editors[$this->_filename] = array('id' => $id, 'name' => $this->_filename, 'keyframes' => array());
         }
         return;
     }
     return;
 }
 /**
  * @param Hoa\Core\Event\Bucket $bucket
  * @return stdClass the response object, or null if the response is invalid
  */
 private function parseResponse(Hoa\Core\Event\Bucket $bucket)
 {
     $data = $bucket->getData();
     $response = json_decode($data['message']);
     return isset($response->method) ? $response : null;
 }