mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
This change is made to comply with the new Symfony standards and to avoid deprecation warnings for future versions. The update touches various functionalities, including retrieving EntityManagerInterface instance and various service classes within the test files.
60 lines
2.2 KiB
PHP
60 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
|
|
use Rector\Config\RectorConfig;
|
|
use Rector\Set\ValueObject\LevelSetList;
|
|
|
|
return static function (RectorConfig $rectorConfig): void {
|
|
$rectorConfig->paths([
|
|
__DIR__ . '/docs',
|
|
__DIR__ . '/src',
|
|
]);
|
|
|
|
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/test/App_KernelTestDebugContainer.xml ');
|
|
$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php');
|
|
|
|
//$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
|
|
//$rectorConfig->cacheDirectory(__DIR__ . '/.cache/rector');
|
|
|
|
// register a single rule
|
|
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
|
|
|
// part of the symfony 54 rules
|
|
$rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class);
|
|
$rectorConfig->disableParallel();
|
|
|
|
//define sets of rules
|
|
$rectorConfig->sets([
|
|
LevelSetList::UP_TO_PHP_82,
|
|
\Rector\Symfony\Set\SymfonyLevelSetList::UP_TO_SYMFONY_50,
|
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50_TYPES,
|
|
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
|
\Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
|
|
]);
|
|
|
|
// some routes are added twice if it remains activated
|
|
// $rectorConfig->rule(\Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector::class);
|
|
|
|
// chill rules
|
|
//$rectorConfig->rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class);
|
|
|
|
// skip some path...
|
|
$rectorConfig->skip([
|
|
// we need to discuss this: are we going to have FALSE in tests instead of an error ?
|
|
\Rector\Php71\Rector\FuncCall\CountOnNullRector::class,
|
|
|
|
// we must adapt service definition
|
|
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
|
|
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
|
|
]);
|
|
};
|