Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
* [Updating from v1 to v2](v1-to-v2-update.md)
* [Updating from v2 to v3](v2-to-v3-update.md)
* [Updating from v3 to v4](v3-to-v4-update.md)
* [Updating from v4 to v5](v4-to-v5-update.md)
10 changes: 10 additions & 0 deletions docs/v4-to-v5-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Updating from v4 to v5

The following changes were made to the Database package between v4 and v5.

### `getBounded()` no longer returns by reference

`QueryInterface::getBounded()` and `DatabaseQuery::getBounded()` return the bound parameters by value. Implementations
of `QueryInterface` should drop the `&` from their declaration, and callers should not assign the result by reference
(`$bounded =& $query->getBounded()`). The bindings themselves still reference the bound variables, so `bind()` works as
before.
2 changes: 1 addition & 1 deletion src/DatabaseDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public function execute()
$this->count++;

// Get list of bound parameters
$bounded =& $this->sql->getBounded();
$bounded = $this->sql->getBounded();

// If there is a monitor registered, let it know we are starting this query
if ($this->monitor) {
Expand Down
2 changes: 1 addition & 1 deletion src/DatabaseQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2029,7 +2029,7 @@ public function __clone()
*
* @since 1.5.0
*/
public function &getBounded($key = null)
public function getBounded($key = null)
{
if (empty($key)) {
return $this->bounded;
Expand Down
2 changes: 1 addition & 1 deletion src/Pdo/PdoDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public function execute()
$this->count++;

// Get list of bounded parameters
$bounded =& $this->sql->getBounded();
$bounded = $this->sql->getBounded();

// If there is a monitor registered, let it know we are starting this query
if ($this->monitor) {
Expand Down
2 changes: 1 addition & 1 deletion src/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ public function unbind($key);
*
* @since 4.0
*/
public function &getBounded($key = null);
public function getBounded($key = null);

/**
* Method to modify a query already in string format with the needed additions to make the query limited to a particular number of
Expand Down
2 changes: 1 addition & 1 deletion src/Sqlsrv/SqlsrvDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public function execute()
$this->count++;

// Get list of bounded parameters
$bounded =& $this->sql->getBounded();
$bounded = $this->sql->getBounded();

// If there is a monitor registered, let it know we are starting this query
if ($this->monitor) {
Expand Down
Loading