<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Php71\Rector\ClassConst\PublicConstantVisibilityRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
use Rector\Php83\Rector\ClassConst\AddTypeToConstRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\PHPUnit\Rector\StmtsAwareInterface\WithConsecutiveRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector;
use Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withRules([
AddTypeToConstRector::class,
ReadOnlyClassRector::class,
DataProviderAnnotationToAttributeRector::class,
StaticDataProviderClassMethodRector::class,
])
->withSets([
LevelSetList::UP_TO_PHP_83
])
->withSkip([
WithConsecutiveRector::class,
ClosureToArrowFunctionRector::class,
PublicConstantVisibilityRector::class,
AddOverrideAttributeToOverriddenMethodsRector::class,
]);
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\Config\RectorConfig;
use Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector;
use Rector\PHPUnit\PHPUnit110\Rector\Class_\NamedArgumentForDataProviderRector;
use Rector\PHPUnit\Rector\StmtsAwareInterface\WithConsecutiveRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
return RectorConfig::configure()
->withSets([
PHPUnitSetList::PHPUNIT_110,
LevelSetList::UP_TO_PHP_83,
SetList::PHP_83,
SymfonySetList::SYMFONY_64,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
])
->withRules([
DataProviderAnnotationToAttributeRector::class,
NamedArgumentForDataProviderRector::class,
CompleteDynamicPropertiesRector::class,
])
->withSkip([
WithConsecutiveRector::class,
AddOverrideAttributeToOverriddenMethodsRector::class,
ReturnNeverTypeRector::class,
TernaryToNullCoalescingRector::class,
ClassPropertyAssignToConstructorPromotionRector::class,
__DIR__ . '/tests/bootstrap.php',
])
->withImportNames();
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonySetList;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/config',
__DIR__ . '/public',
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withSets([
SetList::PHP_83,
SymfonySetList::SYMFONY_64,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
PHPUnitSetList::PHPUNIT_100,
])
->withSymfonyContainerPhp(__DIR__ . '/var/cache/dev/App_KernelDevContainer.php')
->withTypeCoverageLevel(0)
->withPreparedSets(
deadCode: true,
codeQuality: true
)
->withSkip([
__DIR__ . '/src/Migrations',
]);
name: Rector Check
on:
pull_request:
jobs:
rector-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
- name: Install composer dependencies
uses: php-actions/composer@v6
with:
php_version: '8.3'
version: 2
args: --working-dir=./services
ssh_key: ${{ secrets.CLONE_SSH_KEY }}
ssh_key_pub: ${{ secrets.CLONE_SSH_KEY_PUB }}
- name: Set up Directory Permissions
run: |
mkdir -p services/var/cache
mkdir -p services/var/log
sudo chmod -R 777 services/var/cache
sudo chown -R $USER services/var/cache
sudo chmod -R 777 services/var/log
sudo chown -R $USER services/var/log
- name: Check Code
run: |
cd services
php bin/console cache:clear -q
vendor/bin/rector process --dry-run