Skip to content

Instantly share code, notes, and snippets.

@eerison
Last active February 2, 2022 18:35
Show Gist options
  • Save eerison/128df4abfc94a45a812a056f877e9405 to your computer and use it in GitHub Desktop.
Save eerison/128df4abfc94a45a812a056f877e9405 to your computer and use it in GitHub Desktop.
This rule help you to remove the deprecated core bundle from sonata admin project.
<?php
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SKIP, [
StringClassNameToClassConstantRector::class => [
__DIR__ . '/rector.php',
],
]);
// it need to be used with rector php: https://github.com/rectorphp/rector
$services = $containerConfigurator->services();
$services->set(RenameNamespaceRector::class)
->configure([
'Sonata\CoreBundle\Model\ManagerInterface' => 'Sonata\Doctrine\Model\ManagerInterface',
'Sonata\CoreBundle\Form\Type\CollectionType' => 'Sonata\Form\Type\CollectionType',
'Sonata\CoreBundle' => '\Please\Do\Not\Use\Things\From\SonataCoreBundle',
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment