Skip to content

Commit 7c170c4

Browse files
committed
Release v4.4.4
1 parent a033985 commit 7c170c4

File tree

202 files changed

+1320
-1001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+1320
-1001
lines changed

app/Config/App.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class App extends BaseConfig
2727
* 'http://accounts.example.com/':
2828
* ['media.example.com', 'accounts.example.com']
2929
*
30-
* @var string[]
31-
* @phpstan-var list<string>
30+
* @var list<string>
3231
*/
3332
public array $allowedHostnames = [];
3433

app/Config/Autoload.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ class Autoload extends AutoloadConfig
4141
* 'App' => APPPATH
4242
* ];
4343
*
44-
* @var array<string, array<int, string>|string>
45-
* @phpstan-var array<string, string|list<string>>
44+
* @var array<string, list<string>|string>
4645
*/
4746
public $psr4 = [
4847
APP_NAMESPACE => APPPATH, // For custom app namespace
@@ -81,8 +80,7 @@ class Autoload extends AutoloadConfig
8180
* '/path/to/my/file.php',
8281
* ];
8382
*
84-
* @var string[]
85-
* @phpstan-var list<string>
83+
* @var list<string>
8684
*/
8785
public $files = [];
8886

@@ -95,8 +93,7 @@ class Autoload extends AutoloadConfig
9593
* 'form',
9694
* ];
9795
*
98-
* @var string[]
99-
* @phpstan-var list<string>
96+
* @var list<string>
10097
*/
10198
public $helpers = [];
10299
}

app/Config/Boot/development.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
|
1111
| If you set 'display_errors' to '1', CI4's detailed error report will show.
1212
*/
13-
error_reporting(-1);
13+
error_reporting(E_ALL);
1414
ini_set('display_errors', '1');
1515

1616
/*

app/Config/Boot/testing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| make sure they don't make it to production. And save us hours of
1515
| painful debugging.
1616
*/
17-
error_reporting(-1);
17+
error_reporting(E_ALL);
1818
ini_set('display_errors', '1');
1919

2020
/*

app/Config/Cache.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ class Cache extends BaseConfig
158158
* This is an array of cache engine alias' and class names. Only engines
159159
* that are listed here are allowed to be used.
160160
*
161-
* @var array<string, string>
162-
* @phpstan-var array<string, class-string<CacheInterface>>
161+
* @var array<string, class-string<CacheInterface>>
163162
*/
164163
public array $validHandlers = [
165164
'dummy' => DummyHandler::class,

app/Config/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Email extends BaseConfig
2626
public string $mailPath = '/usr/sbin/sendmail';
2727

2828
/**
29-
* SMTP Server Address
29+
* SMTP Server Hostname
3030
*/
3131
public string $SMTPHost = '';
3232

app/Config/Filters.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ class Filters extends BaseConfig
1515
* Configures aliases for Filter classes to
1616
* make reading things nicer and simpler.
1717
*
18-
* @var array<string, array<int, string>|string> [filter_name => classname]
19-
* or [filter_name => [classname1, classname2, ...]]
20-
* @phpstan-var array<string, class-string|list<class-string>>
18+
* @var array<string, class-string|list<class-string>> [filter_name => classname]
19+
* or [filter_name => [classname1, classname2, ...]]
2120
*/
2221
public array $aliases = [
2322
'csrf' => CSRF::class,
@@ -31,8 +30,7 @@ class Filters extends BaseConfig
3130
* List of filter aliases that are always
3231
* applied before and after every request.
3332
*
34-
* @var array<string, array<string, array<string, string>>>|array<string, array<string>>
35-
* @phpstan-var array<string, list<string>>|array<string, array<string, array<string, string>>>
33+
* @var array<string, array<string, array<string, string>>>|array<string, list<string>>
3634
*/
3735
public array $globals = [
3836
'before' => [

app/Config/Kint.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class Kint extends BaseConfig
2727
*/
2828

2929
/**
30-
* @var array<int, ConstructablePluginInterface|string>
31-
* @phpstan-var list<class-string<ConstructablePluginInterface>|ConstructablePluginInterface>
30+
* @var list<class-string<ConstructablePluginInterface>|ConstructablePluginInterface>|null
3231
*/
3332
public $plugins;
3433

@@ -46,14 +45,12 @@ class Kint extends BaseConfig
4645
public int $richSort = AbstractRenderer::SORT_FULL;
4746

4847
/**
49-
* @var array<string, string>
50-
* @phpstan-var array<string, class-string<ValuePluginInterface>>
48+
* @var array<string, class-string<ValuePluginInterface>>|null
5149
*/
5250
public $richObjectPlugins;
5351

5452
/**
55-
* @var array<string, string>
56-
* @phpstan-var array<string, class-string<TabPluginInterface>>
53+
* @var array<string, class-string<TabPluginInterface>>|null
5754
*/
5855
public $richTabPlugins;
5956

app/Config/Modules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Modules extends BaseModules
5858
* ],
5959
* ]
6060
*
61-
* @var array
61+
* @var array{only?: list<string>, exclude?: list<string>}
6262
*/
6363
public $composerPackages = [];
6464

@@ -72,7 +72,7 @@ class Modules extends BaseModules
7272
*
7373
* If it is not listed, only the base application elements will be used.
7474
*
75-
* @var string[]
75+
* @var list<string>
7676
*/
7777
public $aliases = [
7878
'events',

app/Config/Publisher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Publisher extends BasePublisher
1919
* result in a PublisherException. Files that do no fit the
2020
* pattern will cause copy/merge to fail.
2121
*
22-
* @var array<string,string>
22+
* @var array<string, string>
2323
*/
2424
public $restrictions = [
2525
ROOTPATH => '*',

app/Config/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Session extends BaseConfig
1919
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
2020
* - `CodeIgniter\Session\Handlers\RedisHandler`
2121
*
22-
* @phpstan-var class-string<BaseHandler>
22+
* @var class-string<BaseHandler>
2323
*/
2424
public string $driver = FileHandler::class;
2525

app/Views/errors/cli/error_exception.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@
33
use CodeIgniter\CLI\CLI;
44

55
// The main Exception
6-
CLI::newLine();
76
CLI::write('[' . get_class($exception) . ']', 'light_gray', 'red');
8-
CLI::newLine();
97
CLI::write($message);
10-
CLI::newLine();
118
CLI::write('at ' . CLI::color(clean_path($exception->getFile()) . ':' . $exception->getLine(), 'green'));
129
CLI::newLine();
1310

11+
$last = $exception;
12+
13+
while ($prevException = $last->getPrevious()) {
14+
$last = $prevException;
15+
16+
CLI::write(' Caused by:');
17+
CLI::write(' [' . get_class($prevException) . ']', 'red');
18+
CLI::write(' ' . $prevException->getMessage());
19+
CLI::write(' at ' . CLI::color(clean_path($prevException->getFile()) . ':' . $prevException->getLine(), 'green'));
20+
CLI::newLine();
21+
}
22+
1423
// The backtrace
1524
if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
16-
$backtraces = $exception->getTrace();
25+
$backtraces = $last->getTrace();
1726

1827
if ($backtraces) {
1928
CLI::write('Backtrace:', 'green');

app/Views/errors/html/error_exception.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,29 @@
4444
<?php endif; ?>
4545
</div>
4646

47+
<div class="container">
48+
<?php
49+
$last = $exception;
50+
51+
while ($prevException = $last->getPrevious()) {
52+
$last = $prevException;
53+
?>
54+
55+
<pre>
56+
Caused by:
57+
<?= esc(get_class($prevException)), esc($prevException->getCode() ? ' #' . $prevException->getCode() : '') ?>
58+
59+
<?= nl2br(esc($prevException->getMessage())) ?>
60+
<a href="https://www.duckduckgo.com/?q=<?= urlencode(get_class($prevException) . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $prevException->getMessage())) ?>"
61+
rel="noreferrer" target="_blank">search &rarr;</a>
62+
<?= esc(clean_path($prevException->getFile()) . ':' . $prevException->getLine()) ?>
63+
</pre>
64+
65+
<?php
66+
}
67+
?>
68+
</div>
69+
4770
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) : ?>
4871
<div class="container">
4972

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"require-dev": {
2121
"codeigniter/coding-standard": "^1.5",
2222
"fakerphp/faker": "^1.9",
23-
"friendsofphp/php-cs-fixer": "3.13.0",
23+
"friendsofphp/php-cs-fixer": "~3.41.0",
2424
"kint-php/kint": "^5.0.4",
2525
"mikey179/vfsstream": "^1.6",
2626
"nexusphp/cs-config": "^3.6",
@@ -43,6 +43,7 @@
4343
"ext-readline": "Improves CLI::input() usability",
4444
"ext-redis": "If you use Cache class RedisHandler",
4545
"ext-simplexml": "If you format XML",
46+
"ext-sodium": "If you use Encryption SodiumHandler",
4647
"ext-sqlite3": "If you use SQLite3",
4748
"ext-sqlsrv": "If you use SQL Server",
4849
"ext-xdebug": "If you use CIUnitTestCase::assertHeaderEmitted()"

env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@
140140
# CURLRequest
141141
#--------------------------------------------------------------------
142142

143-
# curlrequest.shareOptions = true
143+
# curlrequest.shareOptions = false

spark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
3939
}
4040

4141
// We want errors to be shown when using it from the CLI.
42-
error_reporting(-1);
42+
error_reporting(E_ALL);
4343
ini_set('display_errors', '1');
4444

4545
/**

system/API/ResponseTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function respond($data = null, ?int $status = null, string $message =
9494
$output = null;
9595
$this->format($data);
9696
} else {
97-
$status = empty($status) ? 200 : $status;
97+
$status ??= 200;
9898
$output = $this->format($data);
9999
}
100100

@@ -318,7 +318,7 @@ protected function format($data = null)
318318

319319
// Determine correct response type through content negotiation if not explicitly declared
320320
if (
321-
(empty($this->format) || ! in_array($this->format, ['json', 'xml'], true))
321+
! in_array($this->format, ['json', 'xml'], true)
322322
&& $this->request instanceof IncomingRequest
323323
) {
324324
$mime = $this->request->negotiate(

system/Autoloader/Autoloader.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,15 @@ class Autoloader
7575
/**
7676
* Stores files as a list.
7777
*
78-
* @var string[]
79-
* @phpstan-var list<string>
78+
* @var list<string>
8079
*/
8180
protected $files = [];
8281

8382
/**
8483
* Stores helper list.
8584
* Always load the URL helper, it should be used in most apps.
8685
*
87-
* @var string[]
88-
* @phpstan-var list<string>
86+
* @var list<string>
8987
*/
9088
protected $helpers = ['url'];
9189

@@ -119,7 +117,7 @@ public function initialize(Autoload $config, Modules $modules)
119117
$this->files = $config->files;
120118
}
121119

122-
if (isset($config->helpers)) { // @phpstan-ignore-line
120+
if (isset($config->helpers)) {
123121
$this->helpers = [...$this->helpers, ...$config->helpers];
124122
}
125123

@@ -185,8 +183,7 @@ public function unregister(): void
185183
/**
186184
* Registers namespaces with the autoloader.
187185
*
188-
* @param array<string, array<int, string>|string>|string $namespace
189-
* @phpstan-param array<string, list<string>|string>|string $namespace
186+
* @param array<string, list<string>|string>|string $namespace
190187
*
191188
* @return $this
192189
*/

0 commit comments

Comments
 (0)