Skip to content

Commit 3bbb183

Browse files
authored
load doctrine and twig composer based sets (#8313)
1 parent 85d180e commit 3bbb183

3 files changed

Lines changed: 9 additions & 14 deletions

File tree

‎src/Configuration/RectorConfigBuilder.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use Rector\Set\ValueObject\SetList;
3838
use Rector\Symfony\Set\SymfonyInternalSetList;
3939
use Rector\Symfony\Set\SymfonySetList;
40+
use Rector\Symfony\Set\TwigSetList;
4041
use Rector\ValueObject\Configuration\LevelOverflow;
4142
use Rector\ValueObject\PhpVersion;
4243
use Symfony\Component\Finder\Finder;
@@ -737,7 +738,6 @@ public function withComposerBased(
737738
bool $drupal = false,
738739
): self {
739740
$setMap = [
740-
SetGroup::DOCTRINE => $doctrine,
741741
SetGroup::LARAVEL => $laravel,
742742
SetGroup::DRUPAL => $drupal,
743743
];
@@ -754,11 +754,11 @@ public function withComposerBased(
754754
}
755755

756756
if ($doctrine) {
757-
// $this->sets[] = DoctrineSetList::COMPOSER_BASED;
757+
$this->sets[] = DoctrineSetList::COMPOSER_BASED;
758758
}
759759

760760
if ($twig) {
761-
// $this->sets[] = TwigSetList::COMPOSER_BASED;
761+
$this->sets[] = TwigSetList::COMPOSER_BASED;
762762
}
763763

764764
if ($symfony) {

‎src/Set/Enum/SetGroup.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ final class SetGroup
1313

1414
public const string PHP = 'php';
1515

16-
/**
17-
* Version-based set provider
18-
*/
19-
public const string DOCTRINE = 'doctrine';
20-
2116
/**
2217
* Version-based set provider
2318
*/

‎tests/Bin/RectorTest.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ final class RectorTest extends TestCase
1717
public static function outputProvider(): Iterator
1818
{
1919
yield 'Version' => [
20-
'command' => PHP_BINARY . ' bin/rector --version',
21-
'expectedOutput' => "Rector @package_version@" . PHP_EOL,
20+
'command' => PHP_BINARY . ' bin/rector --version',
21+
'expectedOutput' => 'Rector @package_version@' . PHP_EOL,
2222
];
2323
yield 'Exception with previous console output' => [
24-
'command' => PHP_BINARY . ' bin/rector -c tests/Bin/config/incorrect-phpstan-files.php',
25-
'expectedOutput' => PHP_EOL . " [ERROR] Rector\\NodeTypeResolver\\DependencyInjection\\PHPStanServicesFactory " . PHP_EOL . PHP_EOL . " [ERROR] Unexpected item 'parameters › invalidParameters'. " . PHP_EOL . PHP_EOL,
24+
'command' => PHP_BINARY . ' bin/rector -c tests/Bin/config/incorrect-phpstan-files.php',
25+
'expectedOutput' => PHP_EOL . ' [ERROR] Rector\\NodeTypeResolver\\DependencyInjection\\PHPStanServicesFactory ' . PHP_EOL . PHP_EOL . " [ERROR] Unexpected item 'parameters › invalidParameters'. " . PHP_EOL . PHP_EOL,
2626
];
2727
yield 'Exception with previous console output in JSON format' => [
28-
'command' => PHP_BINARY . ' bin/rector -c tests/Bin/config/incorrect-phpstan-files.php --output-format json',
28+
'command' => PHP_BINARY . ' bin/rector -c tests/Bin/config/incorrect-phpstan-files.php --output-format json',
2929
'expectedOutput' => '{"fatal_errors":["Rector\\\\NodeTypeResolver\\\\DependencyInjection\\\\PHPStanServicesFactory","Unexpected item \'parameters › invalidParameters\'."]}',
3030
];
3131
}
@@ -35,6 +35,6 @@ public function testConsoleOutput(string $command, string $expectedOutput): void
3535
{
3636
$process = Process::fromShellCommandline($command);
3737
$process->run();
38-
$this->assertSame($expectedOutput, preg_replace("/ +/", " ", $process->getOutput()));
38+
$this->assertSame($expectedOutput, preg_replace('/ +/', ' ', $process->getOutput()));
3939
}
4040
}

0 commit comments

Comments
 (0)