Skip to content

Commit

Permalink
[Configuration] Use TwigSetProvider from rector-symfony (#5992)
Browse files Browse the repository at this point in the history
* Remove new TwigSetProvider() on RectorConfig::configure()

* register on twig
  • Loading branch information
samsonasik authored Jun 21, 2024
1 parent cecb60d commit 6b11f63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
6 changes: 1 addition & 5 deletions src/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Rector\Contract\Rector\RectorInterface;
use Rector\DependencyInjection\Laravel\ContainerMemento;
use Rector\Exception\ShouldNotHappenException;
use Rector\Set\SetProvider\TwigSetProvider;
use Rector\Skipper\SkipCriteriaResolver\SkippedClassResolver;
use Rector\Validation\RectorConfigValidator;
use Rector\ValueObject\PhpVersion;
Expand Down Expand Up @@ -42,10 +41,7 @@ final class RectorConfig extends Container

public static function configure(): RectorConfigBuilder
{
$rectorConfigBuilder = new RectorConfigBuilder();
$rectorConfigBuilder->withSetProviders([new TwigSetProvider()]);

return $rectorConfigBuilder;
return new RectorConfigBuilder();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Configuration/RectorConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Rector\Symfony\Set\FOSRestSetList;
use Rector\Symfony\Set\JMSSetList;
use Rector\Symfony\Set\SensiolabsSetList;
use Rector\Symfony\Set\SetProvider\TwigSetProvider;
use Rector\Symfony\Set\SymfonySetList;
use Rector\ValueObject\PhpVersion;
use Symfony\Component\Finder\Finder;
Expand Down Expand Up @@ -659,6 +660,7 @@ public function withPreparedSets(
// @experimental 2024-06
if ($twig) {
$this->setGroups[] = SetGroup::TWIG;
$this->withSetProviders([new TwigSetProvider()]);
}

return $this;
Expand Down
27 changes: 0 additions & 27 deletions src/Set/SetProvider/TwigSetProvider.php

This file was deleted.

0 comments on commit 6b11f63

Please sign in to comment.