Skip to content

Commit 84ff359

Browse files
committed
Release v4.4.8
1 parent e6a2f70 commit 84ff359

33 files changed

+125
-121
lines changed

app/.htaccess

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<IfModule authz_core_module>
2-
Require all denied
2+
Require all denied
33
</IfModule>
44
<IfModule !authz_core_module>
5-
Deny from all
5+
Deny from all
66
</IfModule>

public/.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ Options -Indexes
4545
</IfModule>
4646

4747
# Disable server signature start
48-
ServerSignature Off
48+
ServerSignature Off
4949
# Disable server signature end

system/BaseModel.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,14 @@ abstract class BaseModel
173173
protected $db;
174174

175175
/**
176-
* Rules used to validate data in insert, update, and save methods.
176+
* Rules used to validate data in insert(), update(), and save() methods.
177+
*
177178
* The array must match the format of data passed to the Validation
178179
* library.
179180
*
180-
* @var list<string>|string
181+
* @see https://codeigniter4.github.io/userguide/models/model.html#setting-validation-rules
182+
*
183+
* @var array<string, array<string, array<string, string>|string>|string>|string
181184
*/
182185
protected $validationRules = [];
183186

@@ -243,84 +246,84 @@ abstract class BaseModel
243246
/**
244247
* Callbacks for beforeInsert
245248
*
246-
* @var array
249+
* @var list<string>
247250
*/
248251
protected $beforeInsert = [];
249252

250253
/**
251254
* Callbacks for afterInsert
252255
*
253-
* @var array
256+
* @var list<string>
254257
*/
255258
protected $afterInsert = [];
256259

257260
/**
258261
* Callbacks for beforeUpdate
259262
*
260-
* @var array
263+
* @var list<string>
261264
*/
262265
protected $beforeUpdate = [];
263266

264267
/**
265268
* Callbacks for afterUpdate
266269
*
267-
* @var array
270+
* @var list<string>
268271
*/
269272
protected $afterUpdate = [];
270273

271274
/**
272275
* Callbacks for beforeInsertBatch
273276
*
274-
* @var array
277+
* @var list<string>
275278
*/
276279
protected $beforeInsertBatch = [];
277280

278281
/**
279282
* Callbacks for afterInsertBatch
280283
*
281-
* @var array
284+
* @var list<string>
282285
*/
283286
protected $afterInsertBatch = [];
284287

285288
/**
286289
* Callbacks for beforeUpdateBatch
287290
*
288-
* @var array
291+
* @var list<string>
289292
*/
290293
protected $beforeUpdateBatch = [];
291294

292295
/**
293296
* Callbacks for afterUpdateBatch
294297
*
295-
* @var array
298+
* @var list<string>
296299
*/
297300
protected $afterUpdateBatch = [];
298301

299302
/**
300303
* Callbacks for beforeFind
301304
*
302-
* @var array
305+
* @var list<string>
303306
*/
304307
protected $beforeFind = [];
305308

306309
/**
307310
* Callbacks for afterFind
308311
*
309-
* @var array
312+
* @var list<string>
310313
*/
311314
protected $afterFind = [];
312315

313316
/**
314317
* Callbacks for beforeDelete
315318
*
316-
* @var array
319+
* @var list<string>
317320
*/
318321
protected $beforeDelete = [];
319322

320323
/**
321324
* Callbacks for afterDelete
322325
*
323-
* @var array
326+
* @var list<string>
324327
*/
325328
protected $afterDelete = [];
326329

@@ -1448,7 +1451,7 @@ public function setValidationMessage(string $field, array $fieldMessages)
14481451
* Allows to set (and reset) validation rules.
14491452
* It could be used when you have to change default or override current validate rules.
14501453
*
1451-
* @param array $validationRules Value
1454+
* @param array<string, array<string, array<string, string>|string>|string> $validationRules Value
14521455
*
14531456
* @return $this
14541457
*/

system/CLI/CLI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public static function prompt(string $field, $options = null, $validation = null
262262
$default = $options[0];
263263
}
264264

265-
static::fwrite(STDOUT, $field . (trim($field) ? ' ' : '') . $extraOutput . ': ');
265+
static::fwrite(STDOUT, $field . (trim($field) !== '' ? ' ' : '') . $extraOutput . ': ');
266266

267267
// Read the input from keyboard.
268268
$input = trim(static::input()) ?: $default;
@@ -386,7 +386,7 @@ public static function promptByMultipleKeys(string $text, array $options): array
386386
*/
387387
private static function isZeroOptions(array $options): void
388388
{
389-
if (! $options) {
389+
if ($options === []) {
390390
throw new InvalidArgumentException('No options to select from were provided');
391391
}
392392
}

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CodeIgniter
5454
/**
5555
* The current version of CodeIgniter Framework
5656
*/
57-
public const CI_VERSION = '4.4.7';
57+
public const CI_VERSION = '4.4.8';
5858

5959
/**
6060
* App startup time.

system/Commands/Database/MigrateStatus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function run(array $params)
144144
}
145145
}
146146

147-
if (! $status) {
147+
if ($status === []) {
148148
// @codeCoverageIgnoreStart
149149
CLI::error(lang('Migrations.noneFound'), 'light_gray', 'red');
150150
CLI::newLine();

system/Config/DotEnv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function normaliseVariable(string $name, string $value = ''): array
140140
*/
141141
protected function sanitizeValue(string $value): string
142142
{
143-
if (! $value) {
143+
if ($value === '') {
144144
return $value;
145145
}
146146

system/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private function setValidator($rules, array $messages): void
187187
}
188188

189189
// If no error message is defined, use the error message in the Config\Validation file
190-
if (! $messages) {
190+
if ($messages === []) {
191191
$errorName = $rules . '_errors';
192192
$messages = $validation->{$errorName} ?? [];
193193
}

system/Database/BaseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public function __construct($tableName, ConnectionInterface $db, ?array $options
333333
/**
334334
* Returns the current database connection
335335
*
336-
* @return BaseConnection|ConnectionInterface
336+
* @return BaseConnection
337337
*/
338338
public function db(): ConnectionInterface
339339
{

system/Database/BaseConnection.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ public function getFieldData(string $table)
15271527
/**
15281528
* Returns an object with key data
15291529
*
1530-
* @return array
1530+
* @return array<string, stdClass>
15311531
*/
15321532
public function getIndexData(string $table)
15331533
{
@@ -1547,7 +1547,9 @@ public function getForeignKeyData(string $table)
15471547
/**
15481548
* Converts array of arrays generated by _foreignKeyData() to array of objects
15491549
*
1550-
* @return array[
1550+
* @return array<string, stdClass>
1551+
*
1552+
* array[
15511553
* {constraint_name} =>
15521554
* stdClass[
15531555
* 'constraint_name' => string,
@@ -1704,13 +1706,17 @@ abstract protected function _fieldData(string $table): array;
17041706
* Platform-specific index data.
17051707
*
17061708
* @see getIndexData()
1709+
*
1710+
* @return array<string, stdClass>
17071711
*/
17081712
abstract protected function _indexData(string $table): array;
17091713

17101714
/**
17111715
* Platform-specific foreign keys data.
17121716
*
17131717
* @see getForeignKeyData()
1718+
*
1719+
* @return array<string, stdClass>
17141720
*/
17151721
abstract protected function _foreignKeyData(string $table): array;
17161722

system/Database/BaseResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ public function getResultObject(): array
260260
* @param string $type The type of result object. 'array', 'object' or class name.
261261
* @phpstan-param class-string<T>|'array'|'object' $type
262262
*
263-
* @return array|object|stdClass|null
264-
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : T|null))
263+
* @return array|float|int|object|stdClass|string|null
264+
* @phpstan-return ($n is string ? float|int|string|null : ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : T|null)))
265265
*/
266266
public function getRow($n = 0, string $type = 'object')
267267
{

system/Database/MySQLi/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ protected function _fieldData(string $table): array
443443
/**
444444
* Returns an array of objects with index data
445445
*
446-
* @return list<stdClass>
446+
* @return array<string, stdClass>
447447
*
448448
* @throws DatabaseException
449449
* @throws LogicException
@@ -489,7 +489,7 @@ protected function _indexData(string $table): array
489489
/**
490490
* Returns an array of objects with Foreign key data
491491
*
492-
* @return list<stdClass>
492+
* @return array<string, stdClass>
493493
*
494494
* @throws DatabaseException
495495
*/

system/Database/OCI8/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ protected function _limit(string $sql, bool $offsetIgnore = false): string
222222
}
223223

224224
$this->limitUsed = true;
225-
$limitTemplateQuery = 'SELECT * FROM (SELECT INNER_QUERY.*, ROWNUM RNUM FROM (%s) INNER_QUERY WHERE ROWNUM < %d)' . ($offset ? ' WHERE RNUM >= %d' : '');
225+
$limitTemplateQuery = 'SELECT * FROM (SELECT INNER_QUERY.*, ROWNUM RNUM FROM (%s) INNER_QUERY WHERE ROWNUM < %d)' . ($offset !== 0 ? ' WHERE RNUM >= %d' : '');
226226

227227
return sprintf($limitTemplateQuery, $sql, $offset + $this->QBLimit + 1, $offset);
228228
}

system/Database/OCI8/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ protected function _fieldData(string $table): array
325325
/**
326326
* Returns an array of objects with index data
327327
*
328-
* @return list<stdClass>
328+
* @return array<string, stdClass>
329329
*
330330
* @throws DatabaseException
331331
*/
@@ -374,7 +374,7 @@ protected function _indexData(string $table): array
374374
/**
375375
* Returns an array of objects with Foreign key data
376376
*
377-
* @return list<stdClass>
377+
* @return array<string, stdClass>
378378
*
379379
* @throws DatabaseException
380380
*/

system/Database/Postgre/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ protected function _fieldData(string $table): array
332332
/**
333333
* Returns an array of objects with index data
334334
*
335-
* @return list<stdClass>
335+
* @return array<string, stdClass>
336336
*
337337
* @throws DatabaseException
338338
*/
@@ -371,7 +371,7 @@ protected function _indexData(string $table): array
371371
/**
372372
* Returns an array of objects with Foreign key data
373373
*
374-
* @return list<stdClass>
374+
* @return array<string, stdClass>
375375
*
376376
* @throws DatabaseException
377377
*/

system/Database/ResultInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public function getResultObject(): array;
6363
* @param string $type The type of result object. 'array', 'object' or class name.
6464
* @phpstan-param class-string<T>|'array'|'object' $type
6565
*
66-
* @return array|object|stdClass|null
67-
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : T|null))
66+
* @return array|float|int|object|stdClass|string|null
67+
* @phpstan-return ($n is string ? float|int|string|null : ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : T|null)))
6868
*/
6969
public function getRow($n = 0, string $type = 'object');
7070

system/Database/SQLSRV/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected function _listColumns(string $table = ''): string
231231
/**
232232
* Returns an array of objects with index data
233233
*
234-
* @return list<stdClass>
234+
* @return array<string, stdClass>
235235
*
236236
* @throws DatabaseException
237237
*/
@@ -269,7 +269,7 @@ protected function _indexData(string $table): array
269269
* Returns an array of objects with Foreign key data
270270
* referenced_object_id parent_object_id
271271
*
272-
* @return list<stdClass>
272+
* @return array<string, stdClass>
273273
*
274274
* @throws DatabaseException
275275
*/

system/Database/SQLite3/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ protected function _fieldData(string $table): array
286286
/**
287287
* Returns an array of objects with index data
288288
*
289-
* @return list<stdClass>
289+
* @return array<string, stdClass>
290290
*
291291
* @throws DatabaseException
292292
*/
@@ -343,7 +343,7 @@ protected function _indexData(string $table): array
343343
/**
344344
* Returns an array of objects with Foreign key data
345345
*
346-
* @return list<stdClass>
346+
* @return array<string, stdClass>
347347
*/
348348
protected function _foreignKeyData(string $table): array
349349
{

system/Database/SQLite3/Table.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function addForeignKey(array $foreignKeys)
280280
/**
281281
* Creates the new table based on our current fields.
282282
*
283-
* @return mixed
283+
* @return bool
284284
*/
285285
protected function createTable()
286286
{
@@ -449,16 +449,12 @@ private function isNumericType(string $type): bool
449449
* Converts keys retrieved from the database to
450450
* the format needed to create later.
451451
*
452-
* @param mixed $keys
452+
* @param array<string, stdClass> $keys
453453
*
454-
* @return mixed
454+
* @return array<string, array{fields: string, type: string}>
455455
*/
456456
protected function formatKeys($keys)
457457
{
458-
if (! is_array($keys)) {
459-
return $keys;
460-
}
461-
462458
$return = [];
463459

464460
foreach ($keys as $name => $key) {

0 commit comments

Comments
 (0)