public function decode($body)
 {
     $data = parent::decode($body);
     $this->method = $data['method'];
     $this->id = $data['id'];
     return $data['params'];
 }
Exemple #2
0
 /**
  * @return mixed
  */
 public function getBody()
 {
     $result = null;
     if (!empty($this->headers['Content-Type'])) {
         switch ($this->headers['Content-Type']) {
             case 'application/json':
                 $result = JsonTransformer::decode($this->body);
                 break;
             default:
                 $result = $this->body;
         }
     }
     return $result;
 }