Skip to content

Commit f0a5a4d

Browse files
committed
opt code
1 parent 63d6b4d commit f0a5a4d

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

src/Command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function queryScalar()
9898
public function getRawSql()
9999
{
100100
if (empty($this->params)) {
101-
return $this->getSql();
101+
return $this->_sql;
102102
}
103103
$params = [];
104104
foreach ($this->params as $name => $value) {
@@ -116,10 +116,10 @@ public function getRawSql()
116116
}
117117
}
118118
if (!isset($params[0])) {
119-
return strtr($this->getSql(), $params);
119+
return strtr($this->_sql, $params);
120120
}
121121
$sql = '';
122-
foreach (explode('?', $this->getSql()) as $i => $part) {
122+
foreach (explode('?', $this->_sql) as $i => $part) {
123123
$sql .= $part . (isset($params[$i]) ? $params[$i] : '');
124124
}
125125
return $sql;

src/Connection.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function close()
8383
*/
8484
public function createPdoInstance()
8585
{
86-
$parsed = parse_url($this->dsn);
86+
$parsed = $this->parseDsn;
8787
isset($parsed['query']) ? parse_str($parsed['query'], $parsed['query']) : $parsed['query'] = [];
8888
[$_, $host, $port, $this->username, $this->password, $query] = ArrayHelper::getValueByArray(
8989
$parsed,
@@ -125,24 +125,6 @@ public function __call($name, $arguments)
125125
}
126126
}
127127

128-
/**
129-
* @return bool
130-
*/
131-
public function check(): bool
132-
{
133-
return $this->getIsActive();
134-
}
135-
136-
/**
137-
* @param float $timeout
138-
* @return mixed|void
139-
* @throws NotSupportedException
140-
*/
141-
public function receive(float $timeout = -1)
142-
{
143-
throw new NotSupportedException('can not call ' . __METHOD__);
144-
}
145-
146128
/**
147129
* @return mixed|\rabbit\db\Schema
148130
* @throws DependencyException

0 commit comments

Comments
 (0)