AddVoidReturnTypeWhereNoReturnRector

Add return type void to function like without any return

 final class SomeClass
 {
-    public function getValues()
+    public function getValues(): void
     {
         $value = 1000;
         return;
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;

return RectorConfig::configure()
    ->withRules([
        AddVoidReturnTypeWhereNoReturnRector::class,
    ]);