Skip to content

Commit 99c0a2c

Browse files
authored
Merge pull request #221 from kenjis/update-ci-445
Update to CI 4.4.5
2 parents 68009a4 + 442f0b7 commit 99c0a2c

19 files changed

+71
-6059
lines changed

app/Commands/DungeonsList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DungeonsList extends BaseCommand
2929
protected $usage = 'dungeons:list';
3030

3131
/**
32-
* @var mixed[]
32+
* @var array<string, string>
3333
*/
3434
protected $arguments = [];
3535

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
@@ -28,7 +28,8 @@
2828
"require-dev": {
2929
"psr/container": "1.1.2",
3030
"codeigniter4/devkit": "^1.0",
31-
"tatter/patches": "^2.1"
31+
"tatter/patches": "^2.1",
32+
"kint-php/kint": "^5.1"
3233
},
3334
"minimum-stability": "dev",
3435
"prefer-stable": true,

0 commit comments

Comments
 (0)