-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better support for NoSQL drivers #4074
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -593,11 +593,11 @@ public function addTableAlias(string $table) | |
/** | ||
* Executes the query against the database. | ||
* | ||
* @param string $sql | ||
* @param mixed $sql | ||
* | ||
* @return mixed | ||
*/ | ||
abstract protected function execute(string $sql); | ||
abstract protected function execute($sql); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As stated, changing the signature may be breaking for existing implementations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the var name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The better name for the context will be |
||
|
||
/** | ||
* Orchestrates a query against the database. Queries must use | ||
|
@@ -607,16 +607,16 @@ abstract protected function execute(string $sql); | |
* Should automatically handle different connections for read/write | ||
* queries if needed. | ||
* | ||
* @param string $sql | ||
* @param mixed ...$binds | ||
* @param boolean $setEscapeFlags | ||
* @param string $queryClass | ||
* @param mixed $sql | ||
* @param mixed ...$binds | ||
* @param boolean $setEscapeFlags | ||
* @param string|null $queryClass | ||
* | ||
* @return BaseResult|Query|boolean | ||
* | ||
* @todo BC set $queryClass default as null in 4.1 | ||
*/ | ||
public function query(string $sql, $binds = null, bool $setEscapeFlags = true, string $queryClass = '') | ||
public function query($sql, $binds = null, bool $setEscapeFlags = true, string $queryClass = null) | ||
{ | ||
$queryClass = $queryClass ?: $this->queryClass; | ||
|
||
|
@@ -718,11 +718,11 @@ public function query(string $sql, $binds = null, bool $setEscapeFlags = true, s | |
* is performed, nor are transactions handled. Simply takes a raw | ||
* query string and returns the database-specific result id. | ||
* | ||
* @param string $sql | ||
* @param mixed $sql | ||
* | ||
* @return mixed | ||
*/ | ||
public function simpleQuery(string $sql) | ||
public function simpleQuery($sql) | ||
{ | ||
if (empty($this->connID)) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mixed
means anything. It does not help for code reading.Can you change it to
string|array
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be even needed to use object for such so it can be string|array|object but the main problem is type hint in the method definition. Since merging this one will break all the exiting user implementation where any of these methods have override.