Skip to content

Commit

Permalink
register twig set providers on load
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 20, 2024
1 parent b0456ae commit efc6ad1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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 @@ -41,7 +42,10 @@ final class RectorConfig extends Container

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

return $rectorConfigBuilder;
}

/**
Expand Down Expand Up @@ -143,6 +147,9 @@ public function importNames(bool $importNames = true, bool $importDocBlockNames
SimpleParameterProvider::setParameter(Option::AUTO_IMPORT_DOC_BLOCK_NAMES, $importDocBlockNames);
}

/**
* @todo merge with importShortClasses()
*/
public function importShortClasses(bool $importShortClasses = true): void
{
SimpleParameterProvider::setParameter(Option::IMPORT_SHORT_CLASSES, $importShortClasses);
Expand Down

0 comments on commit efc6ad1

Please sign in to comment.