diff --git a/src/Handlers/ProtoBufferDecoder.php b/src/Handlers/ProtoBufferDecoder.php index a8bb4a8..74e0440 100755 --- a/src/Handlers/ProtoBufferDecoder.php +++ b/src/Handlers/ProtoBufferDecoder.php @@ -1,22 +1,6 @@ values[$messtypes['field']] = new $this->fields[$messtypes['field']]($this->reader); + $method = 'Aliyun\\OTS\\Handlers\\'.$this->fields[$messtypes['field']]; + $this->values[$messtypes['field']] = new $method($this->reader); if ($messtypes['wired'] != $this->values[$messtypes['field']]->wired_type) { throw new Exception('Expected type:' . $messtypes['wired'] . ' but had ' . $this->fields[$messtypes['field']]->wired_type); @@ -273,7 +274,8 @@ protected function _set_value($index, $value) } else { - $this->values[$index] = new $this->fields[$index](); + $method = 'Aliyun\\OTS\\Handlers\\' . $this->fields[$index]; + $this->values[$index] = new $method(); $this->values[$index]->value = $value; } }