Skip to content

Commit 9ce15a9

Browse files
authored
Merge pull request #5726 from kenjis/fix-db-reference
refactor: remove `&` before $db
2 parents 944ae15 + 09b4b8d commit 9ce15a9

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

system/Database/BaseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class BaseBuilder
270270
*
271271
* @throws DatabaseException
272272
*/
273-
public function __construct($tableName, ConnectionInterface &$db, ?array $options = null)
273+
public function __construct($tableName, ConnectionInterface $db, ?array $options = null)
274274
{
275275
if (empty($tableName)) {
276276
throw new DatabaseException('A table must be specified when creating a new Query Builder.');

system/Database/BasePreparedQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
5757

5858
public function __construct(BaseConnection $db)
5959
{
60-
$this->db = &$db;
60+
$this->db = $db;
6161
}
6262

6363
/**

system/Database/BaseUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ abstract class BaseUtils
4949
/**
5050
* Class constructor
5151
*/
52-
public function __construct(ConnectionInterface &$db)
52+
public function __construct(ConnectionInterface $db)
5353
{
54-
$this->db = &$db;
54+
$this->db = $db;
5555
}
5656

5757
/**

system/Database/Forge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class Forge
179179
*/
180180
public function __construct(BaseConnection $db)
181181
{
182-
$this->db = &$db;
182+
$this->db = $db;
183183
}
184184

185185
/**

system/Database/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Query implements QueryInterface
9191
*/
9292
public $db;
9393

94-
public function __construct(ConnectionInterface &$db)
94+
public function __construct(ConnectionInterface $db)
9595
{
9696
$this->db = $db;
9797
}

system/Database/SQLSRV/Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Utils extends BaseUtils
3434
*/
3535
protected $optimizeTable = 'ALTER INDEX all ON %s REORGANIZE';
3636

37-
public function __construct(ConnectionInterface &$db)
37+
public function __construct(ConnectionInterface $db)
3838
{
3939
parent::__construct($db);
4040

system/Database/Seeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct(Database $config, ?BaseConnection $db = null)
9292

9393
$db ??= Database::connect($this->DBGroup);
9494

95-
$this->db = &$db;
95+
$this->db = $db;
9696
$this->forge = Database::forge($this->DBGroup);
9797
}
9898

system/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ class Model extends BaseModel
100100
'getCompiledUpdate',
101101
];
102102

103-
public function __construct(?ConnectionInterface &$db = null, ?ValidationInterface $validation = null)
103+
public function __construct(?ConnectionInterface $db = null, ?ValidationInterface $validation = null)
104104
{
105105
/**
106106
* @var BaseConnection|null $db
107107
*/
108108
$db ??= Database::connect($this->DBGroup);
109109

110-
$this->db = &$db;
110+
$this->db = $db;
111111

112112
parent::__construct($validation);
113113
}

0 commit comments

Comments
 (0)