Skip to content

Commit 1257477

Browse files
authored
IBX-9627: Replaced Symfony code quality set with specific rules (#27)
For more details see https://issues.ibexa.co/browse/IBX-9627 and #27 Key changes: * Dropped volatile Symfony code quality Rector set * Configured directly chosen rules from Symfony code quality Rector set * [Tests] Aligned IbexaRectorConfigFactoryTest with the changes
1 parent f5cf01f commit 1257477

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/contracts/Factory/IbexaRectorConfigFactory.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Ibexa\Contracts\Rector\Sets\IbexaSetList;
1212
use Rector\Config\RectorConfig;
1313
use Rector\Configuration\RectorConfigBuilder;
14+
use Rector\Symfony\CodeQuality\Rector\BinaryOp\ResponseStatusCodeRector;
15+
use Rector\Symfony\CodeQuality\Rector\Class_\EventListenerToEventSubscriberRector;
16+
use Rector\Symfony\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstantRector;
1417
use Rector\Symfony\Set\SymfonySetList;
1518

1619
final readonly class IbexaRectorConfigFactory implements IbexaRectorConfigFactoryInterface
@@ -28,6 +31,13 @@ public function createConfig(): RectorConfigBuilder
2831
{
2932
return RectorConfig::configure()
3033
->withPaths($this->pathsToProcess)
34+
->withRules(
35+
[
36+
EventListenerToEventSubscriberRector::class,
37+
LiteralGetToRequestClassConstantRector::class,
38+
ResponseStatusCodeRector::class,
39+
]
40+
)
3141
->withSets(
3242
array_merge(
3343
[
@@ -39,7 +49,6 @@ public function createConfig(): RectorConfigBuilder
3949
SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES,
4050
SymfonySetList::SYMFONY_53,
4151
SymfonySetList::SYMFONY_54,
42-
SymfonySetList::SYMFONY_CODE_QUALITY,
4352
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
4453
SymfonySetList::SYMFONY_60,
4554
SymfonySetList::SYMFONY_61,

tests/contracts/IbexaRectorConfigFactoryTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
use Rector\Configuration\Parameter\SimpleParameterProvider;
1717
use Rector\Symfony\Set\SymfonySetList;
1818

19+
/**
20+
* @covers \Ibexa\Contracts\Rector\Factory\IbexaRectorConfigFactory
21+
*/
1922
final class IbexaRectorConfigFactoryTest extends TestCase
2023
{
2124
/**
@@ -46,7 +49,6 @@ public static function getSetsForIbexaConfigFactory(): iterable
4649
SymfonySetList::SYMFONY_52,
4750
SymfonySetList::SYMFONY_53,
4851
SymfonySetList::SYMFONY_54,
49-
SymfonySetList::SYMFONY_CODE_QUALITY,
5052
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
5153
SymfonySetList::SYMFONY_60,
5254
SymfonySetList::SYMFONY_61,

0 commit comments

Comments
 (0)