BinaryFileResponseCreateToNewInstanceRector

Change deprecated BinaryFileResponse::create() to use __construct() instead

 use Symfony\Component\HttpFoundation;

 class SomeClass
 {
     public function run()
     {
-        $binaryFile = BinaryFileResponse::create();
+        $binaryFile = new BinaryFileResponse(null);
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony52\Rector\StaticCall\BinaryFileResponseCreateToNewInstanceRector;

return RectorConfig::configure()
    ->withRules([
        BinaryFileResponseCreateToNewInstanceRector::class,
    ]);
SETS:  symfony/* 5.2