@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | /** |
| 93 | 93 | * @param CurlerRolling $curler |
| 94 | 94 | */ |
| 95 | - public function setDirtyCurler(CurlerRolling $curler){ |
|
| 96 | - if ($curler instanceof CurlerRolling){ |
|
| 95 | + public function setDirtyCurler(CurlerRolling $curler) { |
|
| 96 | + if ($curler instanceof CurlerRolling) { |
|
| 97 | 97 | $this->_curler = $curler; |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -129,10 +129,10 @@ discard block |
||
| 129 | 129 | $proto = 'https'; |
| 130 | 130 | } |
| 131 | 131 | $uri = $proto . '://' . $this->_host; |
| 132 | - if (stripos($this->_host,'/')!==false || stripos($this->_host,':')!==false) { |
|
| 132 | + if (stripos($this->_host, '/') !== false || stripos($this->_host, ':') !== false) { |
|
| 133 | 133 | return $uri; |
| 134 | 134 | } |
| 135 | - if (intval($this->_port)>0) { |
|
| 135 | + if (intval($this->_port) > 0) { |
|
| 136 | 136 | return $uri . ':' . $this->_port; |
| 137 | 137 | } |
| 138 | 138 | return $uri; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | $new->timeOut($this->settings()->getTimeOut()); |
| 207 | - $new->connectTimeOut($this->_connectTimeOut);//->keepAlive(); // one sec |
|
| 207 | + $new->connectTimeOut($this->_connectTimeOut); //->keepAlive(); // one sec |
|
| 208 | 208 | $new->verbose(boolval($this->_verbose)); |
| 209 | 209 | |
| 210 | 210 | return $new; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | { |
| 258 | 258 | |
| 259 | 259 | if ($sql instanceof Query) { |
| 260 | - $query=$sql; |
|
| 260 | + $query = $sql; |
|
| 261 | 261 | } else { |
| 262 | 262 | $query = new Query($sql); |
| 263 | 263 | } |
@@ -619,10 +619,10 @@ discard block |
||
| 619 | 619 | * @return Statement |
| 620 | 620 | * @throws \ClickHouseDB\Exception\TransportException |
| 621 | 621 | */ |
| 622 | - private function streaming(Stream $streamRW,CurlerRequest $request) |
|
| 622 | + private function streaming(Stream $streamRW, CurlerRequest $request) |
|
| 623 | 623 | { |
| 624 | - $callable=$streamRW->getClosure(); |
|
| 625 | - $stream=$streamRW->getStream(); |
|
| 624 | + $callable = $streamRW->getClosure(); |
|
| 625 | + $stream = $streamRW->getStream(); |
|
| 626 | 626 | |
| 627 | 627 | |
| 628 | 628 | |
@@ -633,11 +633,11 @@ discard block |
||
| 633 | 633 | if ($streamRW->isWrite()) |
| 634 | 634 | { |
| 635 | 635 | |
| 636 | - $callable = function ($ch, $fd, $length) use ($stream) { |
|
| 636 | + $callable = function($ch, $fd, $length) use ($stream) { |
|
| 637 | 637 | return ($line = fread($stream, $length)) ? $line : ''; |
| 638 | 638 | }; |
| 639 | 639 | } else { |
| 640 | - $callable = function ($ch, $fd) use ($stream) { |
|
| 640 | + $callable = function($ch, $fd) use ($stream) { |
|
| 641 | 641 | return fwrite($stream, $fd); |
| 642 | 642 | }; |
| 643 | 643 | } |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | |
| 675 | - $this->_curler->execOne($request,true); |
|
| 675 | + $this->_curler->execOne($request, true); |
|
| 676 | 676 | $response = new Statement($request); |
| 677 | 677 | if ($response->isError()) { |
| 678 | 678 | $response->error(); |
@@ -694,11 +694,11 @@ discard block |
||
| 694 | 694 | * @return Statement |
| 695 | 695 | * @throws \ClickHouseDB\Exception\TransportException |
| 696 | 696 | */ |
| 697 | - public function streamRead(Stream $streamRead,$sql,$bindings=[]) |
|
| 697 | + public function streamRead(Stream $streamRead, $sql, $bindings = []) |
|
| 698 | 698 | { |
| 699 | - $sql=$this->prepareQuery($sql,$bindings); |
|
| 700 | - $request=$this->getRequestRead($sql); |
|
| 701 | - return $this->streaming($streamRead,$request); |
|
| 699 | + $sql = $this->prepareQuery($sql, $bindings); |
|
| 700 | + $request = $this->getRequestRead($sql); |
|
| 701 | + return $this->streaming($streamRead, $request); |
|
| 702 | 702 | |
| 703 | 703 | } |
| 704 | 704 | |
@@ -709,10 +709,10 @@ discard block |
||
| 709 | 709 | * @return Statement |
| 710 | 710 | * @throws \ClickHouseDB\Exception\TransportException |
| 711 | 711 | */ |
| 712 | - public function streamWrite(Stream $streamWrite,$sql,$bindings=[]) |
|
| 712 | + public function streamWrite(Stream $streamWrite, $sql, $bindings = []) |
|
| 713 | 713 | { |
| 714 | - $sql=$this->prepareQuery($sql,$bindings); |
|
| 714 | + $sql = $this->prepareQuery($sql, $bindings); |
|
| 715 | 715 | $request = $this->writeStreamData($sql); |
| 716 | - return $this->streaming($streamWrite,$request); |
|
| 716 | + return $this->streaming($streamWrite, $request); |
|
| 717 | 717 | } |
| 718 | 718 | } |