Skip to content

Commit 90458ee

Browse files
committed
System/CodeIgniter: Update system to 4.5.3 Codeigniter
1 parent 35b392f commit 90458ee

File tree

9 files changed

+42
-13
lines changed

9 files changed

+42
-13
lines changed

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @var string
1919
*
2020
*/
21-
const CI_VERSION = '4.5.2';
21+
const CI_VERSION = '4.5.3';
2222

2323
$appConfig ??= config(App::class);
2424

system/Config/BaseService.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ public static function serviceExists(string $name): ?string
282282
* Reset shared instances and mocks for testing.
283283
*
284284
* @return void
285+
*
286+
* @testTag only available to test code
285287
*/
286288
public static function reset(bool $initAutoloader = true)
287289
{
@@ -298,6 +300,8 @@ public static function reset(bool $initAutoloader = true)
298300
* Resets any mock and shared instances for a single service.
299301
*
300302
* @return void
303+
*
304+
* @testTag only available to test code
301305
*/
302306
public static function resetSingle(string $name)
303307
{
@@ -311,6 +315,8 @@ public static function resetSingle(string $name)
311315
* @param object $mock
312316
*
313317
* @return void
318+
*
319+
* @testTag only available to test code
314320
*/
315321
public static function injectMock(string $name, $mock)
316322
{

system/Database/BaseBuilder.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,11 +1448,12 @@ public function orHaving($key, $value = null, ?bool $escape = null)
14481448
*/
14491449
public function orderBy(string $orderBy, string $direction = '', ?bool $escape = null)
14501450
{
1451-
$qbOrderBy = [];
14521451
if ($orderBy === '') {
14531452
return $this;
14541453
}
14551454

1455+
$qbOrderBy = [];
1456+
14561457
$direction = strtoupper(trim($direction));
14571458

14581459
if ($direction === 'RANDOM') {
@@ -1463,7 +1464,7 @@ public function orderBy(string $orderBy, string $direction = '', ?bool $escape =
14631464
$direction = in_array($direction, ['ASC', 'DESC'], true) ? ' ' . $direction : '';
14641465
}
14651466

1466-
if (! is_bool($escape)) {
1467+
if ($escape === null) {
14671468
$escape = $this->db->protectIdentifiers;
14681469
}
14691470

@@ -1474,8 +1475,6 @@ public function orderBy(string $orderBy, string $direction = '', ?bool $escape =
14741475
'escape' => false,
14751476
];
14761477
} else {
1477-
$qbOrderBy = [];
1478-
14791478
foreach (explode(',', $orderBy) as $field) {
14801479
$qbOrderBy[] = ($direction === '' && preg_match('/\s+(ASC|DESC)$/i', rtrim($field), $match, PREG_OFFSET_CAPTURE))
14811480
? [

system/Database/BaseConnection.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ public function initialize()
475475

476476
/**
477477
* Close the database connection.
478+
*
479+
* @return void
478480
*/
479481
public function close()
480482
{
@@ -734,6 +736,8 @@ public function simpleQuery(string $sql)
734736
* Disable Transactions
735737
*
736738
* This permits transactions to be disabled at run-time.
739+
*
740+
* @return void
737741
*/
738742
public function transOff()
739743
{
@@ -1434,7 +1438,7 @@ protected function getDriverFunctionPrefix(): string
14341438
/**
14351439
* Returns an array of table names
14361440
*
1437-
* @return array|false
1441+
* @return false|list<string>
14381442
*
14391443
* @throws DatabaseException
14401444
*/
@@ -1461,6 +1465,7 @@ public function listTables(bool $constrainByPrefix = false)
14611465
$query = $this->query($sql);
14621466

14631467
foreach ($query->getResultArray() as $row) {
1468+
/** @var string $table */
14641469
$table = $row['table_name'] ?? $row['TABLE_NAME'] ?? $row[array_key_first($row)];
14651470

14661471
$this->dataCache['table_names'][] = $table;
@@ -1511,7 +1516,7 @@ public function tableExists(string $tableName, bool $cached = true): bool
15111516
/**
15121517
* Fetch Field Names
15131518
*
1514-
* @return array|false
1519+
* @return false|list<string>
15151520
*
15161521
* @throws DatabaseException
15171522
*/
@@ -1588,7 +1593,7 @@ public function getIndexData(string $table)
15881593
/**
15891594
* Returns an object with foreign key data
15901595
*
1591-
* @return array
1596+
* @return array<string, stdClass>
15921597
*/
15931598
public function getForeignKeyData(string $table)
15941599
{
@@ -1747,7 +1752,9 @@ abstract protected function _listColumns(string $table = '');
17471752
/**
17481753
* Platform-specific field data information.
17491754
*
1750-
* @see getFieldData()
1755+
* @return list<stdClass>
1756+
* @see getFieldData()
1757+
*
17511758
*/
17521759
abstract protected function _fieldData(string $table): array;
17531760

system/Database/MySQLi/Connection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ public function connect(bool $persistent = false)
237237
/**
238238
* Keep or establish the connection if no queries have been sent for
239239
* a length of time exceeding the server's idle timeout.
240+
*
241+
* @return void
240242
*/
241243
public function reconnect()
242244
{

system/Database/OCI8/Connection.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ class Connection extends BaseConnection
104104
*/
105105
private function isValidDSN(): bool
106106
{
107+
if ($this->DSN === null || $this->DSN === '') {
108+
return false;
109+
}
110+
107111
foreach ($this->validDSNs as $regexp) {
108112
if (preg_match($regexp, $this->DSN)) {
109113
return true;
@@ -120,13 +124,13 @@ private function isValidDSN(): bool
120124
*/
121125
public function connect(bool $persistent = false)
122126
{
123-
if (empty($this->DSN) && ! $this->isValidDSN()) {
127+
if (! $this->isValidDSN()) {
124128
$this->buildDSN();
125129
}
126130

127131
$func = $persistent ? 'oci_pconnect' : 'oci_connect';
128132

129-
return empty($this->charset)
133+
return ($this->charset === '')
130134
? $func($this->username, $this->password, $this->DSN)
131135
: $func($this->username, $this->password, $this->DSN, $this->charset);
132136
}
@@ -632,7 +636,7 @@ protected function buildDSN()
632636
}
633637

634638
$isEasyConnectableHostName = $this->hostname !== '' && strpos($this->hostname, '/') === false && strpos($this->hostname, ':') === false;
635-
$easyConnectablePort = ! empty($this->port) && ctype_digit($this->port) ? ':' . $this->port : '';
639+
$easyConnectablePort = ($this->port !== '') && ctype_digit((string) $this->port) ? ':' . $this->port : '';
636640
$easyConnectableDatabase = $this->database !== '' ? '/' . ltrim($this->database, '/') : '';
637641

638642
if ($isEasyConnectableHostName && ($easyConnectablePort !== '' || $easyConnectableDatabase !== '')) {

system/Database/Postgre/Connection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public function connect(bool $persistent = false)
101101

102102
/**
103103
* Converts the DSN with semicolon syntax.
104+
*
105+
* @return void
104106
*/
105107
private function convertDSN()
106108
{
@@ -140,6 +142,8 @@ private function convertDSN()
140142
/**
141143
* Keep or establish the connection if no queries have been sent for
142144
* a length of time exceeding the server's idle timeout.
145+
*
146+
* @return void
143147
*/
144148
public function reconnect()
145149
{

system/Database/SQLSRV/Connection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ public function getAllErrorMessages(): string
164164
/**
165165
* Keep or establish the connection if no queries have been sent for
166166
* a length of time exceeding the server's idle timeout.
167+
*
168+
* @return void
167169
*/
168170
public function reconnect()
169171
{

system/Database/SQLite3/Connection.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ class Connection extends BaseConnection
5555
*/
5656
protected $busyTimeout;
5757

58+
/**
59+
* @return void
60+
*/
5861
public function initialize()
5962
{
6063
parent::initialize();
@@ -101,6 +104,8 @@ public function connect(bool $persistent = false)
101104
/**
102105
* Keep or establish the connection if no queries have been sent for
103106
* a length of time exceeding the server's idle timeout.
107+
*
108+
* @return void
104109
*/
105110
public function reconnect()
106111
{
@@ -211,7 +216,7 @@ protected function _listColumns(string $table = ''): string
211216
}
212217

213218
/**
214-
* @return array|false
219+
* @return false|list<string>
215220
*
216221
* @throws DatabaseException
217222
*/

0 commit comments

Comments
 (0)