ParameterBagTypedGetMethodCallRector

Make use of specific ParameterBag::get*() method with native return type declaration

 use Symfony\Component\HttpFoundation\Request;

 class SomeClass
 {
     public function run(Request $request)
     {
-        $debug = (bool) $request->query->get('debug', false);
+        $debug = $request->query->getBoolean('debug');
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Symfony\CodeQuality\Rector\MethodCall\ParameterBagTypedGetMethodCallRector;

return RectorConfig::configure()
    ->withRules([
        ParameterBagTypedGetMethodCallRector::class,
    ]);
SETS:  Code Quality