Skip to content

Commit 200cc6d

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
Conflicts: system/Debug/Exceptions.php
2 parents c88bf4f + d8bd77f commit 200cc6d

13 files changed

Lines changed: 51 additions & 119 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"phpunit/phpcov": "^8.2",
3131
"phpunit/phpunit": "^9.1",
3232
"predis/predis": "^1.1 || ^2.0",
33-
"rector/rector": "0.17.10",
33+
"rector/rector": "0.17.11",
3434
"vimeo/psalm": "^5.0"
3535
},
3636
"suggest": {

phpstan-baseline.php

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -676,76 +676,6 @@
676676
'count' => 1,
677677
'path' => __DIR__ . '/system/Database/Seeder.php',
678678
];
679-
$ignoreErrors[] = [
680-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:exceptionHandler\\(\\) has no return type specified\\.$#',
681-
'count' => 1,
682-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
683-
];
684-
$ignoreErrors[] = [
685-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:initialize\\(\\) has no return type specified\\.$#',
686-
'count' => 1,
687-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
688-
];
689-
$ignoreErrors[] = [
690-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:render\\(\\) has no return type specified\\.$#',
691-
'count' => 1,
692-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
693-
];
694-
$ignoreErrors[] = [
695-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:shutdownHandler\\(\\) has no return type specified\\.$#',
696-
'count' => 1,
697-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
698-
];
699-
$ignoreErrors[] = [
700-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Iterator\\:\\:add\\(\\) has parameter \\$closure with no signature specified for Closure\\.$#',
701-
'count' => 1,
702-
'path' => __DIR__ . '/system/Debug/Iterator.php',
703-
];
704-
$ignoreErrors[] = [
705-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Timer\\:\\:record\\(\\) has parameter \\$callable with no signature specified for callable\\.$#',
706-
'count' => 1,
707-
'path' => __DIR__ . '/system/Debug/Timer.php',
708-
];
709-
$ignoreErrors[] = [
710-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\:\\:prepare\\(\\) has no return type specified\\.$#',
711-
'count' => 1,
712-
'path' => __DIR__ . '/system/Debug/Toolbar.php',
713-
];
714-
$ignoreErrors[] = [
715-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\:\\:respond\\(\\) has no return type specified\\.$#',
716-
'count' => 1,
717-
'path' => __DIR__ . '/system/Debug/Toolbar.php',
718-
];
719-
$ignoreErrors[] = [
720-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\BaseCollector\\:\\:getBadgeValue\\(\\) has no return type specified\\.$#',
721-
'count' => 1,
722-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/BaseCollector.php',
723-
];
724-
$ignoreErrors[] = [
725-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\BaseCollector\\:\\:getVarData\\(\\) has no return type specified\\.$#',
726-
'count' => 1,
727-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/BaseCollector.php',
728-
];
729-
$ignoreErrors[] = [
730-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\Database\\:\\:collect\\(\\) has no return type specified\\.$#',
731-
'count' => 1,
732-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Database.php',
733-
];
734-
$ignoreErrors[] = [
735-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\Database\\:\\:getConnections\\(\\) has no return type specified\\.$#',
736-
'count' => 1,
737-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Database.php',
738-
];
739-
$ignoreErrors[] = [
740-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\History\\:\\:setFiles\\(\\) has no return type specified\\.$#',
741-
'count' => 1,
742-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/History.php',
743-
];
744-
$ignoreErrors[] = [
745-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\Logs\\:\\:collectLogs\\(\\) has no return type specified\\.$#',
746-
'count' => 1,
747-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Logs.php',
748-
];
749679
$ignoreErrors[] = [
750680
'message' => '#^Property CodeIgniter\\\\Log\\\\Logger\\:\\:\\$logCache \\(array\\) on left side of \\?\\? is not nullable\\.$#',
751681
'count' => 1,
@@ -1091,11 +1021,6 @@
10911021
'count' => 1,
10921022
'path' => __DIR__ . '/system/Model.php',
10931023
];
1094-
$ignoreErrors[] = [
1095-
'message' => '#^Method CodeIgniter\\\\Router\\\\AutoRouter\\:\\:setDirectory\\(\\) has no return type specified\\.$#',
1096-
'count' => 1,
1097-
'path' => __DIR__ . '/system/Router/AutoRouter.php',
1098-
];
10991024
$ignoreErrors[] = [
11001025
'message' => '#^Property CodeIgniter\\\\Router\\\\AutoRouter\\:\\:\\$cliRoutes type has no signature specified for Closure\\.$#',
11011026
'count' => 1,
@@ -1111,11 +1036,6 @@
11111036
'count' => 1,
11121037
'path' => __DIR__ . '/system/Router/RouteCollection.php',
11131038
];
1114-
$ignoreErrors[] = [
1115-
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:create\\(\\) has no return type specified\\.$#',
1116-
'count' => 1,
1117-
'path' => __DIR__ . '/system/Router/RouteCollection.php',
1118-
];
11191039
$ignoreErrors[] = [
11201040
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:create\\(\\) has parameter \\$to with no signature specified for Closure\\.$#',
11211041
'count' => 1,
@@ -1126,11 +1046,6 @@
11261046
'count' => 1,
11271047
'path' => __DIR__ . '/system/Router/RouteCollection.php',
11281048
];
1129-
$ignoreErrors[] = [
1130-
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:discoverRoutes\\(\\) has no return type specified\\.$#',
1131-
'count' => 1,
1132-
'path' => __DIR__ . '/system/Router/RouteCollection.php',
1133-
];
11341049
$ignoreErrors[] = [
11351050
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:environment\\(\\) has parameter \\$callback with no signature specified for Closure\\.$#',
11361051
'count' => 1,
@@ -1151,11 +1066,6 @@
11511066
'count' => 1,
11521067
'path' => __DIR__ . '/system/Router/RouteCollection.php',
11531068
];
1154-
$ignoreErrors[] = [
1155-
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:group\\(\\) has no return type specified\\.$#',
1156-
'count' => 1,
1157-
'path' => __DIR__ . '/system/Router/RouteCollection.php',
1158-
];
11591069
$ignoreErrors[] = [
11601070
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:group\\(\\) has parameter \\$params with no signature specified for callable\\.$#',
11611071
'count' => 1,
@@ -1191,11 +1101,6 @@
11911101
'count' => 1,
11921102
'path' => __DIR__ . '/system/Router/RouteCollection.php',
11931103
];
1194-
$ignoreErrors[] = [
1195-
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:resetRoutes\\(\\) has no return type specified\\.$#',
1196-
'count' => 1,
1197-
'path' => __DIR__ . '/system/Router/RouteCollection.php',
1198-
];
11991104
$ignoreErrors[] = [
12001105
'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollection\\:\\:set404Override\\(\\) has parameter \\$callable with no signature specified for callable\\.$#',
12011106
'count' => 1,
@@ -1261,11 +1166,6 @@
12611166
'count' => 1,
12621167
'path' => __DIR__ . '/system/Router/Router.php',
12631168
];
1264-
$ignoreErrors[] = [
1265-
'message' => '#^Method CodeIgniter\\\\Router\\\\Router\\:\\:autoRoute\\(\\) has no return type specified\\.$#',
1266-
'count' => 1,
1267-
'path' => __DIR__ . '/system/Router/Router.php',
1268-
];
12691169
$ignoreErrors[] = [
12701170
'message' => '#^Method CodeIgniter\\\\Router\\\\Router\\:\\:controllerName\\(\\) return type has no signature specified for Closure\\.$#',
12711171
'count' => 1,
@@ -1281,26 +1181,11 @@
12811181
'count' => 1,
12821182
'path' => __DIR__ . '/system/Router/Router.php',
12831183
];
1284-
$ignoreErrors[] = [
1285-
'message' => '#^Method CodeIgniter\\\\Router\\\\Router\\:\\:setDefaultController\\(\\) has no return type specified\\.$#',
1286-
'count' => 1,
1287-
'path' => __DIR__ . '/system/Router/Router.php',
1288-
];
1289-
$ignoreErrors[] = [
1290-
'message' => '#^Method CodeIgniter\\\\Router\\\\Router\\:\\:setDirectory\\(\\) has no return type specified\\.$#',
1291-
'count' => 1,
1292-
'path' => __DIR__ . '/system/Router/Router.php',
1293-
];
12941184
$ignoreErrors[] = [
12951185
'message' => '#^Method CodeIgniter\\\\Router\\\\Router\\:\\:setMatchedRoute\\(\\) has parameter \\$handler with no signature specified for callable\\.$#',
12961186
'count' => 1,
12971187
'path' => __DIR__ . '/system/Router/Router.php',
12981188
];
1299-
$ignoreErrors[] = [
1300-
'message' => '#^Method CodeIgniter\\\\Router\\\\Router\\:\\:setRequest\\(\\) has no return type specified\\.$#',
1301-
'count' => 1,
1302-
'path' => __DIR__ . '/system/Router/Router.php',
1303-
];
13041189
$ignoreErrors[] = [
13051190
'message' => '#^Property CodeIgniter\\\\Router\\\\Router\\:\\:\\$controller type has no signature specified for Closure\\.$#',
13061191
'count' => 1,

system/Debug/Exceptions.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public function __construct(ExceptionsConfig $config)
9999
* handling of our application.
100100
*
101101
* @codeCoverageIgnore
102+
*
103+
* @return void
102104
*/
103105
public function initialize()
104106
{
@@ -111,6 +113,9 @@ public function initialize()
111113
* Catches any uncaught errors and exceptions, including most Fatal errors
112114
* (Yay PHP7!). Will log the error, display it if display_errors is on,
113115
* and fire an event that allows custom actions to be taken at this point.
116+
*
117+
* @return void
118+
* @phpstan-return never|void
114119
*/
115120
public function exceptionHandler(Throwable $exception)
116121
{
@@ -206,6 +211,9 @@ public function errorHandler(int $severity, string $message, ?string $file = nul
206211
* need to be caught and handle them.
207212
*
208213
* @codeCoverageIgnore
214+
*
215+
* @return void
216+
* @phpstan-return never|void
209217
*/
210218
public function shutdownHandler()
211219
{
@@ -263,6 +271,9 @@ protected function determineView(Throwable $exception, string $templatePath): st
263271
/**
264272
* Given an exception and status code will display the error to the client.
265273
*
274+
* @return void
275+
* @phpstan-return never|void
276+
*
266277
* @deprecated 4.4.0 No longer used. Moved to BaseExceptionHandler.
267278
*/
268279
protected function render(Throwable $exception, int $statusCode)

system/Debug/Iterator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class Iterator
3838
* Tests are simply closures that the user can define any sequence of
3939
* things to happen during the test.
4040
*
41+
* @phpstan-param Closure(): mixed $closure
42+
*
4143
* @return $this
4244
*/
4345
public function add(string $name, Closure $closure)

system/Debug/Timer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ public function has(string $name): bool
131131
* Executes callable and measures its time.
132132
* Returns its return value if any.
133133
*
134-
* @param string $name The name of the timer
135-
* @param callable $callable callable to be executed
134+
* @param string $name The name of the timer
135+
* @phpstan-param callable(): mixed $callable callable to be executed
136136
*
137137
* @return array|bool|float|int|object|resource|string|null
138138
*/

system/Debug/Toolbar.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ protected function roundTo(float $number, int $increments = 5): float
348348
*
349349
* @param RequestInterface $request
350350
* @param ResponseInterface $response
351+
*
352+
* @return void
351353
*/
352354
public function prepare(?RequestInterface $request = null, ?ResponseInterface $response = null)
353355
{
@@ -434,6 +436,9 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
434436
* Inject debug toolbar into the response.
435437
*
436438
* @codeCoverageIgnore
439+
*
440+
* @return void
441+
* @phpstan-return never|void
437442
*/
438443
public function respond()
439444
{

system/Debug/Toolbar/Collectors/BaseCollector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public function hasVarData(): bool
137137
* 'bar' => 'baz'
138138
* ],
139139
* ];
140+
*
141+
* @return array|null
140142
*/
141143
public function getVarData()
142144
{
@@ -183,6 +185,8 @@ public function cleanPath(string $file): string
183185

184186
/**
185187
* Gets the "badge" value for the button.
188+
*
189+
* @return int|null
186190
*/
187191
public function getBadgeValue()
188192
{

system/Debug/Toolbar/Collectors/Database.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public function __construct()
7676
* data.
7777
*
7878
* @internal
79+
*
80+
* @return void
81+
* @phpstan-return never|void
7982
*/
8083
public static function collect(Query $query)
8184
{
@@ -247,7 +250,7 @@ public function icon(): string
247250
/**
248251
* Gets the connections from the database config
249252
*/
250-
private function getConnections()
253+
private function getConnections(): void
251254
{
252255
$this->connections = \Config\Database::getConnections();
253256
}

system/Debug/Toolbar/Collectors/History.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class History extends BaseCollector
6060
*
6161
* @param string $current Current history time
6262
* @param int $limit Max history files
63+
*
64+
* @return void
6365
*/
6466
public function setFiles(string $current, int $limit = 20)
6567
{

system/Debug/Toolbar/Collectors/Logs.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public function icon(): string
8181

8282
/**
8383
* Ensures the data has been collected.
84+
*
85+
* @return array
8486
*/
8587
protected function collectLogs()
8688
{

0 commit comments

Comments
 (0)