Skip to content

Commit 2793a83

Browse files
committed
Fix: Repair conflicts and emove the Debug ignore errors.
1 parent 6dfc38b commit 2793a83

9 files changed

Lines changed: 34 additions & 73 deletions

File tree

phpstan-baseline.php

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -716,76 +716,6 @@
716716
'count' => 1,
717717
'path' => __DIR__ . '/system/Database/Seeder.php',
718718
];
719-
$ignoreErrors[] = [
720-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:exceptionHandler\\(\\) has no return type specified\\.$#',
721-
'count' => 1,
722-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
723-
];
724-
$ignoreErrors[] = [
725-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:initialize\\(\\) has no return type specified\\.$#',
726-
'count' => 1,
727-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
728-
];
729-
$ignoreErrors[] = [
730-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:render\\(\\) has no return type specified\\.$#',
731-
'count' => 1,
732-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
733-
];
734-
$ignoreErrors[] = [
735-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Exceptions\\:\\:shutdownHandler\\(\\) has no return type specified\\.$#',
736-
'count' => 1,
737-
'path' => __DIR__ . '/system/Debug/Exceptions.php',
738-
];
739-
$ignoreErrors[] = [
740-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Iterator\\:\\:add\\(\\) has parameter \\$closure with no signature specified for Closure\\.$#',
741-
'count' => 1,
742-
'path' => __DIR__ . '/system/Debug/Iterator.php',
743-
];
744-
$ignoreErrors[] = [
745-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Timer\\:\\:record\\(\\) has parameter \\$callable with no signature specified for callable\\.$#',
746-
'count' => 1,
747-
'path' => __DIR__ . '/system/Debug/Timer.php',
748-
];
749-
$ignoreErrors[] = [
750-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\:\\:prepare\\(\\) has no return type specified\\.$#',
751-
'count' => 1,
752-
'path' => __DIR__ . '/system/Debug/Toolbar.php',
753-
];
754-
$ignoreErrors[] = [
755-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\:\\:respond\\(\\) has no return type specified\\.$#',
756-
'count' => 1,
757-
'path' => __DIR__ . '/system/Debug/Toolbar.php',
758-
];
759-
$ignoreErrors[] = [
760-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\BaseCollector\\:\\:getBadgeValue\\(\\) has no return type specified\\.$#',
761-
'count' => 1,
762-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/BaseCollector.php',
763-
];
764-
$ignoreErrors[] = [
765-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\BaseCollector\\:\\:getVarData\\(\\) has no return type specified\\.$#',
766-
'count' => 1,
767-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/BaseCollector.php',
768-
];
769-
$ignoreErrors[] = [
770-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\Database\\:\\:collect\\(\\) has no return type specified\\.$#',
771-
'count' => 1,
772-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Database.php',
773-
];
774-
$ignoreErrors[] = [
775-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\Database\\:\\:getConnections\\(\\) has no return type specified\\.$#',
776-
'count' => 1,
777-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Database.php',
778-
];
779-
$ignoreErrors[] = [
780-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\History\\:\\:setFiles\\(\\) has no return type specified\\.$#',
781-
'count' => 1,
782-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/History.php',
783-
];
784-
$ignoreErrors[] = [
785-
'message' => '#^Method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\Logs\\:\\:collectLogs\\(\\) has no return type specified\\.$#',
786-
'count' => 1,
787-
'path' => __DIR__ . '/system/Debug/Toolbar/Collectors/Logs.php',
788-
];
789719
$ignoreErrors[] = [
790720
'message' => '#^Property CodeIgniter\\\\Log\\\\Logger\\:\\:\\$logCache \\(array\\) on left side of \\?\\? is not nullable\\.$#',
791721
'count' => 1,

system/Debug/Exceptions.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ public function __construct(ExceptionsConfig $config, $request, ResponseInterfac
9898
* handling of our application.
9999
*
100100
* @codeCoverageIgnore
101+
*
102+
* @return void
103+
* @phpstan-return never|void
101104
*/
102105
public function initialize()
103106
{
@@ -112,6 +115,9 @@ public function initialize()
112115
* and fire an event that allows custom actions to be taken at this point.
113116
*
114117
* @codeCoverageIgnore
118+
*
119+
* @return void
120+
* @phpstan-return never|void
115121
*/
116122
public function exceptionHandler(Throwable $exception)
117123
{
@@ -189,6 +195,9 @@ public function errorHandler(int $severity, string $message, ?string $file = nul
189195
* need to be caught and handle them.
190196
*
191197
* @codeCoverageIgnore
198+
*
199+
* @return void
200+
* @phpstan-return never|void
192201
*/
193202
public function shutdownHandler()
194203
{
@@ -243,6 +252,9 @@ protected function determineView(Throwable $exception, string $templatePath): st
243252

244253
/**
245254
* Given an exception and status code will display the error to the client.
255+
*
256+
* @return void
257+
* @phpstan-return never|void
246258
*/
247259
protected function render(Throwable $exception, int $statusCode)
248260
{

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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ protected function roundTo(float $number, int $increments = 5): float
348348
*
349349
* @param RequestInterface $request
350350
* @param ResponseInterface $response
351+
*
352+
* @return void
353+
* @phpstan-return never|void
351354
*/
352355
public function prepare(?RequestInterface $request = null, ?ResponseInterface $response = null)
353356
{
@@ -434,6 +437,9 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
434437
* Inject debug toolbar into the response.
435438
*
436439
* @codeCoverageIgnore
440+
*
441+
* @return void
442+
* @phpstan-return never|void
437443
*/
438444
public function respond()
439445
{

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)