Skip to content

Commit

Permalink
修正几个new 的语法,增加命名空间
Browse files Browse the repository at this point in the history
  • Loading branch information
fengchenghao committed Oct 18, 2017
1 parent 3d3d904 commit da10b37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
16 changes: 0 additions & 16 deletions src/Handlers/ProtoBufferDecoder.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
<?php
namespace Aliyun\OTS\Handlers;

use CreateTableResponse;
use ListTableResponse;
use DeleteTableResponse;
use DescribeTableResponse;
use UpdateTableResponse;
use GetRowResponse;
use PutRowResponse;
use UpdateRowResponse;
use DeleteRowResponse;
use BatchGetRowResponse;
use BatchWriteRowResponse;
use GetRangeResponse;

use ColumnType;


class ProtoBufferDecoder
{
public function handleBefore($context)
Expand Down
6 changes: 4 additions & 2 deletions src/ProtoBuffer/pb_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ private function _ParseFromArray($length=99999999)
}
else
{
$this->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);
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit da10b37

Please sign in to comment.