DefinitionAliasSetPrivateToSetPublicRector

Migrates from deprecated Definition/Alias->setPrivate() to Definition/Alias->setPublic()

 use Symfony\Component\DependencyInjection\Alias;
 use Symfony\Component\DependencyInjection\Definition;

 class SomeClass
 {
     public function run()
     {
         $definition = new Definition('Example\Foo');
-        $definition->setPrivate(false);
+        $definition->setPublic(true);

         $alias = new Alias('Example\Foo');
-        $alias->setPrivate(false);
+        $alias->setPublic(true);
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony52\Rector\MethodCall\DefinitionAliasSetPrivateToSetPublicRector;

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