Skip to content

Commit

Permalink
IBX-9627: Replaced Symfony code quality set with specific rules (#27)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alongosz authored Feb 27, 2025
1 parent f5cf01f commit 1257477
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/contracts/Factory/IbexaRectorConfigFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Ibexa\Contracts\Rector\Sets\IbexaSetList;
use Rector\Config\RectorConfig;
use Rector\Configuration\RectorConfigBuilder;
use Rector\Symfony\CodeQuality\Rector\BinaryOp\ResponseStatusCodeRector;
use Rector\Symfony\CodeQuality\Rector\Class_\EventListenerToEventSubscriberRector;
use Rector\Symfony\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstantRector;
use Rector\Symfony\Set\SymfonySetList;

final readonly class IbexaRectorConfigFactory implements IbexaRectorConfigFactoryInterface
Expand All @@ -28,6 +31,13 @@ public function createConfig(): RectorConfigBuilder
{
return RectorConfig::configure()
->withPaths($this->pathsToProcess)
->withRules(
[
EventListenerToEventSubscriberRector::class,
LiteralGetToRequestClassConstantRector::class,
ResponseStatusCodeRector::class,
]
)
->withSets(
array_merge(
[
Expand All @@ -39,7 +49,6 @@ public function createConfig(): RectorConfigBuilder
SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES,
SymfonySetList::SYMFONY_53,
SymfonySetList::SYMFONY_54,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::SYMFONY_60,
SymfonySetList::SYMFONY_61,
Expand Down
4 changes: 3 additions & 1 deletion tests/contracts/IbexaRectorConfigFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Rector\Configuration\Parameter\SimpleParameterProvider;
use Rector\Symfony\Set\SymfonySetList;

/**
* @covers \Ibexa\Contracts\Rector\Factory\IbexaRectorConfigFactory
*/
final class IbexaRectorConfigFactoryTest extends TestCase
{
/**
Expand Down Expand Up @@ -46,7 +49,6 @@ public static function getSetsForIbexaConfigFactory(): iterable
SymfonySetList::SYMFONY_52,
SymfonySetList::SYMFONY_53,
SymfonySetList::SYMFONY_54,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::SYMFONY_60,
SymfonySetList::SYMFONY_61,
Expand Down

0 comments on commit 1257477

Please sign in to comment.