Skip to content

Commit ded0c91

Browse files
Enable void_return code fixer (#3045)
The `void_return` rule was previously disabled due to other broken type annotations trickling through the inheritance hierarchy and causing it to choose the wrong annotations. Now that #3011 is complete, this is no longer an issue and the `void_return` fixer can be re-enabled.
1 parent 77321cf commit ded0c91

File tree

196 files changed

+646
-3228
lines changed

Some content is hidden

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

196 files changed

+646
-3228
lines changed

.php-cs-fixer.dist.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@
3232
'global_namespace_import' => ['import_classes' => true, 'import_constants' => null, 'import_functions' => null],
3333
'phpdoc_align' => ['align' => 'left'],
3434
'declare_strict_types' => false, // TODO: turn this back on. Currently causes errors...
35-
'void_return' => false, // TODO: turn this back on. Currently causes errors...
3635
])->setFinder($finder);

app/Console/Kernel.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ class Kernel extends ConsoleKernel
1313
{
1414
/**
1515
* Define the application's command schedule.
16-
*
17-
* @return void
1816
*/
19-
protected function schedule(Schedule $schedule)
17+
protected function schedule(Schedule $schedule): void
2018
{
2119
$schedule->job(new PruneJobs())
2220
->hourly()
@@ -42,10 +40,8 @@ protected function schedule(Schedule $schedule)
4240

4341
/**
4442
* Register the commands for the application.
45-
*
46-
* @return void
4743
*/
48-
protected function commands()
44+
protected function commands(): void
4945
{
5046
$this->load(__DIR__ . '/Commands');
5147

app/Exceptions/Handler.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ class Handler extends ExceptionHandler
3232

3333
/**
3434
* Report or log an exception.
35-
*
36-
* @return void
3735
*/
38-
public function report(Throwable $exception)
36+
public function report(Throwable $exception): void
3937
{
4038
parent::report($exception);
4139
}

app/Http/Controllers/BuildController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ public function build_file(int $build_id, int $file_id): StreamedResponse
802802
'Content-Type' => 'text/plain',
803803
'Content-Disposition' => "inline/attachment; filename={$filename}",
804804
];
805-
return response()->streamDownload(function () use ($fp) {
805+
return response()->streamDownload(function () use ($fp): void {
806806
while (!feof($fp)) {
807807
echo fread($fp, 1024);
808808
}

app/Http/Controllers/DynamicAnalysisController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function apiViewDynamicAnalysis(): JsonResponse
8686
DB::table('dynamicanalysis')
8787
->where('buildid', '=', $this->build->Id)
8888
->orderBy('status', 'desc')
89-
->chunk(50, function ($rows) use (&$dynamic_analyses, &$defect_types, $defect_nice_names) {
89+
->chunk(50, function ($rows) use (&$dynamic_analyses, &$defect_types, $defect_nice_names): void {
9090
foreach ($rows as $DA_row) {
9191
$dynamic_analysis = [];
9292
$dynamic_analysis['status'] = ucfirst($DA_row->status);

app/Http/Controllers/ImageController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function image(Image $image): StreamedResponse
1818
abort(404);
1919
}
2020

21-
return response()->stream(function () use ($image) {
21+
return response()->stream(function () use ($image): void {
2222
echo $image->Data;
2323
}, 200, ['Content-type' => $image->Extension]);
2424
}

app/Http/Controllers/TestController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public function apiTestSummary(): JsonResponse|StreamedResponse
343343
$filecontent .= "\n";
344344
}
345345

346-
return response()->streamDownload(function () use ($filecontent) {
346+
return response()->streamDownload(function () use ($filecontent): void {
347347
echo $filecontent;
348348
}, 'test-export.csv', ['Content-type' => 'text/csv']);
349349
}

app/Http/Controllers/UserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ public function recoverPassword(): View
431431
$text .= "$url\n";
432432
$text .= "\n\nGenerated by CDash";
433433

434-
Mail::raw($text, function ($message) use ($email) {
434+
Mail::raw($text, function ($message) use ($email): void {
435435
$message->subject('CDash password recovery')
436436
->to($email);
437437
});

app/Http/Controllers/ViewTestController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function fetchPageContent(): JsonResponse|StreamedResponse
5858
$headers = [
5959
'Content-Type' => 'text/csv',
6060
];
61-
return response()->streamDownload(function () use ($response) {
61+
return response()->streamDownload(function () use ($response): void {
6262
echo $response;
6363
}, 'test-export.csv', $headers);
6464
}

app/Http/Submission/Handlers/BuildHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public function endElement($parser, $name): void
554554
parent::endElement($parser, $name);
555555
}
556556

557-
public function text($parser, $data)
557+
public function text($parser, $data): void
558558
{
559559
$element = $this->getElement();
560560
if ($this->getParent() === 'BUILD') {

0 commit comments

Comments
 (0)