Skip to content

Commit ddb915c

Browse files
committed
Fix english in no response message
1 parent 4390b4e commit ddb915c

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
git fetch origin $TRAVIS_BRANCH;
7878
fi
7979
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
80-
- wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
80+
- wget https://github.com/diff-sniffer/git/releases/download/0.2.0/git-phpcs.phar
8181
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA
8282

8383
# - stage: Code Quality

src/Exception/QueryException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ public static function cannotInsertEmptyValues() : self
1212
{
1313
return new self('Inserting empty values array is not supported in ClickHouse');
1414
}
15+
16+
public static function noResponse() : self {
17+
return new self('No response returned');
18+
}
1519
}

src/Statement.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,10 @@ public function isError()
183183
return ($this->response()->http_code() !== 200 || $this->response()->error_no());
184184
}
185185

186-
/**
187-
* @return bool
188-
* @throws Exception\TransportException
189-
*/
190-
private function check()
186+
private function check() : bool
191187
{
192188
if (!$this->_request->isResponseExists()) {
193-
throw new QueryException('Not have response');
189+
throw QueryException::noResponse();
194190
}
195191

196192
if ($this->isError()) {

src/Transport/CurlerRequest.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ class CurlerRequest
4444
*/
4545
private $handle;
4646

47-
/**
48-
* @var CurlerResponse
49-
*/
50-
private $resp = null;
47+
/** @var CurlerResponse */
48+
private $response;
5149

5250
/**
5351
* @var bool
@@ -616,24 +614,21 @@ private function execute($method)
616614
*/
617615
public function response()
618616
{
619-
if (!$this->resp) {
617+
if (!$this->response) {
620618
throw new \ClickHouseDB\Exception\TransportException('Can`t fetch response - is empty');
621619
}
622620

623-
return $this->resp;
621+
return $this->response;
624622
}
625623

626-
/**
627-
* @return bool
628-
*/
629-
public function isResponseExists()
624+
public function isResponseExists() : bool
630625
{
631-
return ($this->resp ? true : false);
626+
return $this->response !== null;
632627
}
633628

634-
public function setResponse(CurlerResponse $response)
629+
public function setResponse(CurlerResponse $response) : void
635630
{
636-
$this->resp = $response;
631+
$this->response = $response;
637632
}
638633

639634
/**

0 commit comments

Comments
 (0)