mirror of https://github.com/rectorphp/rector.git
[Testing] Use single config-based testing to isolate scope unite testing for core + community packages (#5837)
This commit is contained in:
parent
9e0c9a5c03
commit
163b37a30a
|
@ -19,8 +19,10 @@ phpunit.xml export-ignore
|
|||
rector.php export-ignore
|
||||
# @see: https://github.com/rectorphp/rector/issues/4905
|
||||
bin/rector.php !export-ignore
|
||||
|
||||
utils export-ignore
|
||||
stubs export-ignore
|
||||
|
||||
tests export-ignore
|
||||
packages-tests export-ignore
|
||||
rules-tests export-ignore
|
||||
|
|
|
@ -23,10 +23,11 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: shivammathur/setup-php@v2
|
||||
-
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none # disable xdebug, pcov
|
||||
coverage: none
|
||||
|
||||
- uses: "ramsey/composer-install@v1"
|
||||
|
||||
|
|
|
@ -109,7 +109,9 @@
|
|||
"rules-tests/CakePHP/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/Source",
|
||||
"rules-tests/CodingStyle/Rector/Namespace_/ImportFullyQualifiedNamesRector/Source",
|
||||
"rules-tests/Renaming/Rector/Name/RenameClassRector/Source",
|
||||
"rules-tests/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector/Source"
|
||||
"rules-tests/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector/Source",
|
||||
"rules-tests/CodingStyle/Rector/Namespace_/ImportFullyQualifiedNamesRector/Source",
|
||||
"rules-tests/Renaming/Rector/Name/RenameClassRector/Source"
|
||||
],
|
||||
"files": [
|
||||
"stubs/Doctrine/Persistence/ObjectManager.php",
|
||||
|
@ -120,7 +122,6 @@
|
|||
"rules-tests/Transform/Rector/FuncCall/FuncCallToMethodCallRector/Source/some_view_function.php",
|
||||
"rules-tests/TypeDeclaration/Rector/FunctionLike/ReturnTypeDeclarationRector/Source/MyBar.php",
|
||||
"rules-tests/TypeDeclaration/Rector/Property/CompleteVarDocTypePropertyRector/Source/EventDispatcher.php",
|
||||
"vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php",
|
||||
"tests/debug_functions.php"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\RectorGenerator\Bundle\RectorGeneratorBundle;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -22,6 +23,16 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$containerConfigurator->import(__DIR__ . '/../../rector-laravel/config/config.php', null, 'not_found');
|
||||
$containerConfigurator->import(__DIR__ . '/../../rector-phpunit/config/config.php', null, 'not_found');
|
||||
|
||||
$containerConfigurator->import(__DIR__ . '/../vendor/symplify/console-color-diff/config/config.php');
|
||||
$containerConfigurator->import(__DIR__ . '/../vendor/symplify/composer-json-manipulator/config/config.php');
|
||||
$containerConfigurator->import(__DIR__ . '/../vendor/symplify/skipper/config/config.php');
|
||||
$containerConfigurator->import(__DIR__ . '/../vendor/symplify/simple-php-doc-parser/config/config.php');
|
||||
|
||||
// only for dev
|
||||
if (class_exists(RectorGeneratorBundle::class)) {
|
||||
$containerConfigurator->import(__DIR__ . '/../vendor/rector/rector-generator/config/config.php');
|
||||
}
|
||||
|
||||
// require only in dev
|
||||
$containerConfigurator->import(__DIR__ . '/../utils/compiler/config/config.php', null, 'not_found');
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
__DIR__ . '/../packages/BetterPhpDocParser/Attributes/Attribute',
|
||||
__DIR__ . '/../packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php',
|
||||
__DIR__ . '/../packages/Testing/PHPUnit',
|
||||
__DIR__ . '/../packages/Testing/PhpConfigPrinter/YamlFileContentProvider.php',
|
||||
__DIR__ . '/../packages/Testing/PhpConfigPrinter/SymfonyVersionFeatureGuard.php',
|
||||
|
||||
// used in PHPStan
|
||||
__DIR__ . '/../packages/NodeTypeResolver/Reflection/BetterReflection/RectorBetterReflectionSourceLocatorFactory.php',
|
||||
|
|
|
@ -6,8 +6,6 @@ use Rector\Core\Configuration\Option;
|
|||
use Rector\PSR4\Composer\PSR4NamespaceMatcher;
|
||||
use Rector\PSR4\Contract\PSR4AutoloadNamespaceMatcherInterface;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
use Symfony\Component\Yaml\Parser;
|
||||
use Symplify\PhpConfigPrinter\Printer\PhpParserPhpConfigPrinter;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$parameters = $containerConfigurator->parameters();
|
||||
|
@ -25,8 +23,4 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
|
||||
$services->load('Rector\\', __DIR__ . '/../rules')
|
||||
->exclude([__DIR__ . '/../rules/*/{ValueObject,Rector,Contract,Exception}']);
|
||||
|
||||
// symfony code-quality
|
||||
$services->set(Parser::class);
|
||||
$services->set(PhpParserPhpConfigPrinter::class);
|
||||
};
|
||||
|
|
|
@ -71,7 +71,7 @@ final class ChangedFilesDetectorTest extends AbstractRectorTestCase
|
|||
];
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config.php';
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ abstract class AbstractNodeTypeResolverTest extends AbstractKernelTestCase
|
|||
protected function getNodesForFileOfType(string $file, string $type): array
|
||||
{
|
||||
$nodes = $this->testingParser->parseFileToDecoratedNodes($file);
|
||||
|
||||
return $this->betterNodeFinder->findInstanceOf($nodes, $type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\Application;
|
||||
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
|
||||
final class EnabledRectorClassProvider
|
||||
{
|
||||
/**
|
||||
* @var class-string<RectorInterface>|null
|
||||
*/
|
||||
private $enabledRectorClass;
|
||||
|
||||
/**
|
||||
* @param class-string<RectorInterface> $rectorClass
|
||||
*/
|
||||
public function setEnabledRectorClass(string $rectorClass): void
|
||||
{
|
||||
$this->enabledRectorClass = $rectorClass;
|
||||
}
|
||||
|
||||
public function isConfigured(): bool
|
||||
{
|
||||
return $this->enabledRectorClass !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return class-string<RectorInterface>
|
||||
*/
|
||||
public function getEnabledRectorClass(): string
|
||||
{
|
||||
if ($this->enabledRectorClass === null) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
|
||||
return $this->enabledRectorClass;
|
||||
}
|
||||
|
||||
public function reset(): void
|
||||
{
|
||||
$this->enabledRectorClass = null;
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\Configuration;
|
||||
|
||||
use Rector\Testing\Finder\RectorsFinder;
|
||||
use Rector\Testing\PhpConfigPrinter\PhpConfigPrinterFactory;
|
||||
use Symplify\PhpConfigPrinter\Printer\SmartPhpConfigPrinter;
|
||||
use Symplify\SmartFileSystem\SmartFileSystem;
|
||||
|
||||
final class AllRectorConfigFactory
|
||||
{
|
||||
/**
|
||||
* @var RectorsFinder
|
||||
*/
|
||||
private $rectorsFinder;
|
||||
|
||||
/**
|
||||
* @var SmartPhpConfigPrinter
|
||||
*/
|
||||
private $smartPhpConfigPrinter;
|
||||
|
||||
/**
|
||||
* @var SmartFileSystem
|
||||
*/
|
||||
private $smartFileSystem;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $configFilePath;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->rectorsFinder = new RectorsFinder();
|
||||
$this->smartFileSystem = new SmartFileSystem();
|
||||
|
||||
$phpConfigPrinterFactory = new PhpConfigPrinterFactory();
|
||||
$this->smartPhpConfigPrinter = $phpConfigPrinterFactory->create();
|
||||
|
||||
$this->configFilePath = sys_get_temp_dir() . '/_rector_tests/all_rectors_config.php';
|
||||
}
|
||||
|
||||
public function create(): string
|
||||
{
|
||||
$rectorClasses = $this->rectorsFinder->findCoreRectorClasses();
|
||||
$services = array_fill_keys($rectorClasses, null);
|
||||
|
||||
$allRectorsContent = $this->smartPhpConfigPrinter->printConfiguredServices($services);
|
||||
$this->smartFileSystem->dumpFile($this->configFilePath, $allRectorsContent);
|
||||
|
||||
return $this->configFilePath;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Rector\Testing\Contract;
|
||||
|
||||
interface CommunityRectorTestCaseInterface
|
||||
interface RectorTestInterface
|
||||
{
|
||||
public function provideConfigFilePath(): string;
|
||||
}
|
|
@ -1,159 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\Finder;
|
||||
|
||||
use Nette\Loaders\RobotLoader;
|
||||
use Nette\Utils\Strings;
|
||||
use Rector\Core\Contract\Rector\PhpRectorInterface;
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use Rector\Core\Error\ExceptionCorrector;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\PostRector\Contract\Rector\PostRectorInterface;
|
||||
use ReflectionClass;
|
||||
|
||||
final class RectorsFinder
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private const RECTOR_PATHS = [
|
||||
__DIR__ . '/../../../rules',
|
||||
__DIR__ . '/../../../packages',
|
||||
__DIR__ . '/../../../src',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array<class-string<RectorInterface>>
|
||||
*/
|
||||
public function findCoreRectorClasses(): array
|
||||
{
|
||||
$allRectors = $this->findInDirectoriesAndCreate(self::RECTOR_PATHS);
|
||||
|
||||
$rectorClasses = array_map(function (RectorInterface $rector): string {
|
||||
return get_class($rector);
|
||||
}, $allRectors);
|
||||
|
||||
// for consistency
|
||||
sort($rectorClasses);
|
||||
|
||||
return $rectorClasses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $directories
|
||||
* @return RectorInterface[]
|
||||
*/
|
||||
public function findInDirectoriesAndCreate(array $directories): array
|
||||
{
|
||||
$foundClasses = $this->findClassesInDirectoriesByName($directories, '*Rector.php');
|
||||
|
||||
$rectors = [];
|
||||
foreach ($foundClasses as $foundClass) {
|
||||
if ($this->shouldSkipClass($foundClass)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass($foundClass);
|
||||
$rector = $reflectionClass->newInstanceWithoutConstructor();
|
||||
if (! $rector instanceof RectorInterface) {
|
||||
// lowercase letter bug in RobotLoader
|
||||
if (Strings::endsWith($foundClass, 'rector')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new ShouldNotHappenException(sprintf(
|
||||
'"%s" found something that looks like Rector but does not implements "%s" interface.',
|
||||
__METHOD__,
|
||||
RectorInterface::class
|
||||
));
|
||||
}
|
||||
|
||||
/** @var RectorInterface[] $rectors */
|
||||
$rectors[] = $rector;
|
||||
}
|
||||
|
||||
return $this->sortRectorObjectsByShortClassName($rectors);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PhpRectorInterface[]
|
||||
*/
|
||||
public function findAndCreatePhpRectors(): array
|
||||
{
|
||||
$coreRectors = $this->findInDirectoriesAndCreate(self::RECTOR_PATHS);
|
||||
|
||||
return array_filter($coreRectors, function (RectorInterface $rector): bool {
|
||||
return $rector instanceof PhpRectorInterface;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $directories
|
||||
* @return array<class-string>
|
||||
*/
|
||||
private function findClassesInDirectoriesByName(array $directories, string $name): array
|
||||
{
|
||||
$robotLoader = new RobotLoader();
|
||||
$robotLoader->addDirectory(...$directories);
|
||||
|
||||
$robotLoader->setTempDirectory(sys_get_temp_dir() . '/_rector_finder');
|
||||
|
||||
$robotLoader->acceptFiles = [$name];
|
||||
|
||||
$robotLoader->refresh();
|
||||
$robotLoader->rebuild();
|
||||
|
||||
return array_keys($robotLoader->getIndexedClasses());
|
||||
}
|
||||
|
||||
private function shouldSkipClass(string $class): bool
|
||||
{
|
||||
// not relevant for documentation
|
||||
if (is_a($class, PostRectorInterface::class, true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// special case, because robot loader is case insensitive
|
||||
if ($class === ExceptionCorrector::class) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// test fixture class
|
||||
if ($class === 'Rector\ModeratePackage\Rector\MethodCall\WhateverRector') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($class === 'Utils\Rector\Rector\MethodCall\WhateverRector') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (! class_exists($class)) {
|
||||
$message = sprintf('Class "%s" was not found', $class);
|
||||
throw new ShouldNotHappenException($message);
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass($class);
|
||||
return $reflectionClass->isAbstract();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RectorInterface[] $objects
|
||||
* @return RectorInterface[]
|
||||
*/
|
||||
private function sortRectorObjectsByShortClassName(array $objects): array
|
||||
{
|
||||
usort(
|
||||
$objects,
|
||||
function (object $firstObject, object $secondObject): int {
|
||||
$firstRectorShortClass = Strings::after(get_class($firstObject), '\\', -1);
|
||||
$secondRectorShortClass = Strings::after(get_class($secondObject), '\\', -1);
|
||||
|
||||
return $firstRectorShortClass <=> $secondRectorShortClass;
|
||||
}
|
||||
);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\Guard;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use Rector\Core\Exception\Testing\SuperfluousAfterContentFixtureException;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class FixtureGuard
|
||||
{
|
||||
/**
|
||||
* @see https://regex101.com/r/xaNeNi/3
|
||||
* @var string
|
||||
*/
|
||||
private const BEFORE_AFTER_CONTENT_REGEX = '#^(?<before_content>.*?)\-\-\-\-\-\n(?<after_content>.*?)$#s';
|
||||
|
||||
public function ensureFileInfoHasDifferentBeforeAndAfterContent(SmartFileInfo $smartFileInfo): void
|
||||
{
|
||||
$match = Strings::match($smartFileInfo->getContents(), self::BEFORE_AFTER_CONTENT_REGEX);
|
||||
if ($match === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$beforeContent = trim($match['before_content']);
|
||||
$afterContent = trim($match['after_content']);
|
||||
if ($beforeContent !== $afterContent) {
|
||||
return;
|
||||
}
|
||||
|
||||
$exceptionMessage = sprintf(
|
||||
'The part after "-----" can be removed in "%s" file. It is the same as top half, so no change is required.',
|
||||
$smartFileInfo->getRelativeFilePathFromCwd()
|
||||
);
|
||||
throw new SuperfluousAfterContentFixtureException($exceptionMessage);
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\PHPUnit;
|
||||
|
||||
use Iterator;
|
||||
use PHPStan\Analyser\NodeScopeResolver;
|
||||
use Rector\Core\Application\FileProcessor;
|
||||
use Rector\Core\Bootstrap\RectorConfigsResolver;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\HttpKernel\RectorKernel;
|
||||
use Rector\Testing\Contract\CommunityRectorTestCaseInterface;
|
||||
use Rector\Testing\Guard\FixtureGuard;
|
||||
use Symplify\EasyTesting\DataProvider\StaticFixtureFinder;
|
||||
use Symplify\EasyTesting\DataProvider\StaticFixtureUpdater;
|
||||
use Symplify\EasyTesting\StaticFixtureSplitter;
|
||||
use Symplify\PackageBuilder\Parameter\ParameterProvider;
|
||||
use Symplify\PackageBuilder\Testing\AbstractKernelTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
abstract class AbstractCommunityRectorTestCase extends AbstractKernelTestCase implements CommunityRectorTestCaseInterface
|
||||
{
|
||||
/**
|
||||
* @var FileProcessor
|
||||
*/
|
||||
protected $fileProcessor;
|
||||
|
||||
/**
|
||||
* @var ParameterProvider
|
||||
*/
|
||||
protected $parameterProvider;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private static $isInitialized = false;
|
||||
|
||||
/**
|
||||
* @var FixtureGuard
|
||||
*/
|
||||
private static $fixtureGuard;
|
||||
|
||||
/**
|
||||
* @var RectorConfigsResolver
|
||||
*/
|
||||
private static $rectorConfigsResolver;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->initializeDependencies();
|
||||
|
||||
$smartFileInfo = new SmartFileInfo($this->provideConfigFilePath());
|
||||
$configFileInfos = self::$rectorConfigsResolver->resolveFromConfigFileInfo($smartFileInfo);
|
||||
|
||||
$this->bootKernelWithConfigs(RectorKernel::class, $configFileInfos);
|
||||
|
||||
$this->fileProcessor = $this->getService(FileProcessor::class);
|
||||
$this->parameterProvider = $this->getService(ParameterProvider::class);
|
||||
}
|
||||
|
||||
protected function doTestFileInfo(SmartFileInfo $fixtureFileInfo, bool $shouldAutoload = true): void
|
||||
{
|
||||
self::$fixtureGuard->ensureFileInfoHasDifferentBeforeAndAfterContent($fixtureFileInfo);
|
||||
|
||||
$inputFileInfoAndExpectedFileInfo = StaticFixtureSplitter::splitFileInfoToLocalInputAndExpectedFileInfos(
|
||||
$fixtureFileInfo,
|
||||
$shouldAutoload
|
||||
);
|
||||
|
||||
$inputFileInfo = $inputFileInfoAndExpectedFileInfo->getInputFileInfo();
|
||||
|
||||
// needed for PHPStan, because the analyzed file is just create in /temp
|
||||
/** @var NodeScopeResolver $nodeScopeResolver */
|
||||
$nodeScopeResolver = $this->getService(NodeScopeResolver::class);
|
||||
$nodeScopeResolver->setAnalysedFiles([$inputFileInfo->getRealPath()]);
|
||||
|
||||
$expectedFileInfo = $inputFileInfoAndExpectedFileInfo->getExpectedFileInfo();
|
||||
$this->doTestFileMatchesExpectedContent($inputFileInfo, $expectedFileInfo, $fixtureFileInfo);
|
||||
}
|
||||
|
||||
protected function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc'): Iterator
|
||||
{
|
||||
return StaticFixtureFinder::yieldDirectory($directory, $suffix);
|
||||
}
|
||||
|
||||
private function doTestFileMatchesExpectedContent(
|
||||
SmartFileInfo $originalFileInfo,
|
||||
SmartFileInfo $expectedFileInfo,
|
||||
SmartFileInfo $fixtureFileInfo
|
||||
): void {
|
||||
$this->parameterProvider->changeParameter(Option::SOURCE, [$originalFileInfo->getRealPath()]);
|
||||
|
||||
$this->fileProcessor->parseFileInfoToLocalCache($originalFileInfo);
|
||||
$this->fileProcessor->refactor($originalFileInfo);
|
||||
$this->fileProcessor->postFileRefactor($originalFileInfo);
|
||||
|
||||
// mimic post-rectors
|
||||
$changedContent = $this->fileProcessor->printToString($originalFileInfo);
|
||||
$relativeFilePathFromCwd = $fixtureFileInfo->getRelativeFilePathFromCwd();
|
||||
|
||||
if (getenv('UPDATE_TESTS') || getenv('UT')) {
|
||||
StaticFixtureUpdater::updateFixtureContent($originalFileInfo, $changedContent, $fixtureFileInfo);
|
||||
}
|
||||
|
||||
$this->assertStringEqualsFile($expectedFileInfo->getRealPath(), $changedContent, $relativeFilePathFromCwd);
|
||||
}
|
||||
|
||||
private function initializeDependencies(): void
|
||||
{
|
||||
if (self::$isInitialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$fixtureGuard = new FixtureGuard();
|
||||
self::$rectorConfigsResolver = new RectorConfigsResolver();
|
||||
|
||||
self::$isInitialized = true;
|
||||
}
|
||||
}
|
|
@ -13,16 +13,13 @@ use Rector\Core\Application\FileProcessor;
|
|||
use Rector\Core\Application\FileSystem\RemovedAndAddedFilesCollector;
|
||||
use Rector\Core\Bootstrap\RectorConfigsResolver;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\HttpKernel\RectorKernel;
|
||||
use Rector\Core\NonPhpFile\NonPhpFileProcessor;
|
||||
use Rector\Core\PhpParser\Printer\BetterStandardPrinter;
|
||||
use Rector\Core\ValueObject\StaticNonPhpFileSuffixes;
|
||||
use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\DynamicSourceLocatorProvider;
|
||||
use Rector\Testing\Application\EnabledRectorClassProvider;
|
||||
use Rector\Testing\Configuration\AllRectorConfigFactory;
|
||||
use Rector\Testing\Guard\FixtureGuard;
|
||||
use Rector\Testing\Contract\RectorTestInterface;
|
||||
use Rector\Testing\PHPUnit\Behavior\MovingFilesTrait;
|
||||
use Symplify\EasyTesting\DataProvider\StaticFixtureFinder;
|
||||
use Symplify\EasyTesting\DataProvider\StaticFixtureUpdater;
|
||||
|
@ -30,9 +27,8 @@ use Symplify\EasyTesting\StaticFixtureSplitter;
|
|||
use Symplify\PackageBuilder\Parameter\ParameterProvider;
|
||||
use Symplify\PackageBuilder\Testing\AbstractKernelTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
use Symplify\SmartFileSystem\SmartFileSystem;
|
||||
|
||||
abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
||||
abstract class AbstractRectorTestCase extends AbstractKernelTestCase implements RectorTestInterface
|
||||
{
|
||||
use MovingFilesTrait;
|
||||
|
||||
|
@ -41,11 +37,6 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
*/
|
||||
protected $fileProcessor;
|
||||
|
||||
/**
|
||||
* @var SmartFileSystem
|
||||
*/
|
||||
protected static $smartFileSystem;
|
||||
|
||||
/**
|
||||
* @var NonPhpFileProcessor
|
||||
*/
|
||||
|
@ -56,11 +47,6 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
*/
|
||||
protected $parameterProvider;
|
||||
|
||||
/**
|
||||
* @var FixtureGuard
|
||||
*/
|
||||
protected static $fixtureGuard;
|
||||
|
||||
/**
|
||||
* @var RemovedAndAddedFilesCollector
|
||||
*/
|
||||
|
@ -93,26 +79,15 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
|
||||
protected function setUp(): void
|
||||
{
|
||||
// speed up
|
||||
@ini_set('memory_limit', '-1');
|
||||
|
||||
$this->initializeDependencies();
|
||||
|
||||
if ($this->provideConfigFilePath() !== '') {
|
||||
$configFileInfo = new SmartFileInfo($this->provideConfigFilePath());
|
||||
$configFileInfos = self::$rectorConfigsResolver->resolveFromConfigFileInfo($configFileInfo);
|
||||
$configFileInfo = new SmartFileInfo($this->provideConfigFilePath());
|
||||
$configFileInfos = self::$rectorConfigsResolver->resolveFromConfigFileInfo($configFileInfo);
|
||||
|
||||
$this->bootKernelWithConfigsAndStaticCache(RectorKernel::class, $configFileInfos);
|
||||
|
||||
/** @var EnabledRectorClassProvider $enabledRectorsProvider */
|
||||
$enabledRectorsProvider = $this->getService(EnabledRectorClassProvider::class);
|
||||
$enabledRectorsProvider->reset();
|
||||
} else {
|
||||
// prepare container with all rectors
|
||||
// cache only rector tests - defined in phpunit.xml
|
||||
$this->createRectorRepositoryContainer();
|
||||
|
||||
/** @var EnabledRectorClassProvider $enabledRectorsProvider */
|
||||
$enabledRectorsProvider = $this->getService(EnabledRectorClassProvider::class);
|
||||
$enabledRectorsProvider->setEnabledRectorClass($this->getRectorClass());
|
||||
}
|
||||
$this->bootKernelWithConfigsAndStaticCache(RectorKernel::class, $configFileInfos);
|
||||
|
||||
$this->fileProcessor = $this->getService(FileProcessor::class);
|
||||
$this->nonPhpFileProcessor = $this->getService(NonPhpFileProcessor::class);
|
||||
|
@ -123,18 +98,9 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
$this->removedAndAddedFilesCollector->reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return class-string<RectorInterface>
|
||||
*/
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
// can be implemented
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
{
|
||||
// can be implemented
|
||||
// must be implemented
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -151,8 +117,6 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
*/
|
||||
protected function doTestFileInfo(SmartFileInfo $fixtureFileInfo, array $extraFileInfos = []): void
|
||||
{
|
||||
self::$fixtureGuard->ensureFileInfoHasDifferentBeforeAndAfterContent($fixtureFileInfo);
|
||||
|
||||
$inputFileInfoAndExpectedFileInfo = StaticFixtureSplitter::splitFileInfoToLocalInputAndExpectedFileInfos(
|
||||
$fixtureFileInfo,
|
||||
false
|
||||
|
@ -160,7 +124,7 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
|
||||
$inputFileInfo = $inputFileInfoAndExpectedFileInfo->getInputFileInfo();
|
||||
|
||||
// needed for PHPStan, because the analyzed file is just created in /temp
|
||||
// needed for PHPStan, because the analyzed file is just created in /temp - need for trait and similar deps
|
||||
/** @var NodeScopeResolver $nodeScopeResolver */
|
||||
$nodeScopeResolver = $this->getService(NodeScopeResolver::class);
|
||||
$nodeScopeResolver->setAnalysedFiles([$inputFileInfo->getRealPath()]);
|
||||
|
@ -216,21 +180,6 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
return sys_get_temp_dir() . '/_temp_fixture_easy_testing';
|
||||
}
|
||||
|
||||
private function createRectorRepositoryContainer(): void
|
||||
{
|
||||
if (self::$allRectorContainer === null) {
|
||||
$allRectorConfigFactory = new AllRectorConfigFactory();
|
||||
$configFilePath = $allRectorConfigFactory->create();
|
||||
$this->bootKernelWithConfigs(RectorKernel::class, [$configFilePath]);
|
||||
|
||||
self::$allRectorContainer = self::$container;
|
||||
return;
|
||||
}
|
||||
|
||||
// load from cache
|
||||
self::$container = self::$allRectorContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SmartFileInfo[] $extraFileInfos
|
||||
*/
|
||||
|
@ -307,8 +256,6 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
|||
return;
|
||||
}
|
||||
|
||||
self::$smartFileSystem = new SmartFileSystem();
|
||||
self::$fixtureGuard = new FixtureGuard();
|
||||
self::$rectorConfigsResolver = new RectorConfigsResolver();
|
||||
self::$isInitialized = true;
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\PhpConfigPrinter;
|
||||
|
||||
use Symplify\PhpConfigPrinter\HttpKernel\PhpConfigPrinterKernel;
|
||||
use Symplify\PhpConfigPrinter\Printer\SmartPhpConfigPrinter;
|
||||
|
||||
final class PhpConfigPrinterFactory
|
||||
{
|
||||
public function create(): SmartPhpConfigPrinter
|
||||
{
|
||||
$phpConfigPrinterKernel = new PhpConfigPrinterKernel('prod', true);
|
||||
$phpConfigPrinterKernel->setConfigs([__DIR__ . '/config/php-config-printer-config.php']);
|
||||
|
||||
$phpConfigPrinterKernel->boot();
|
||||
|
||||
$container = $phpConfigPrinterKernel->getContainer();
|
||||
|
||||
return $container->get(SmartPhpConfigPrinter::class);
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\PhpConfigPrinter;
|
||||
|
||||
use Symplify\PhpConfigPrinter\Contract\SymfonyVersionFeatureGuardInterface;
|
||||
|
||||
final class SymfonyVersionFeatureGuard implements SymfonyVersionFeatureGuardInterface
|
||||
{
|
||||
public function isAtLeastSymfonyVersion(float $symfonyVersion): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Testing\PhpConfigPrinter;
|
||||
|
||||
use Symplify\PhpConfigPrinter\Contract\YamlFileContentProviderInterface;
|
||||
|
||||
final class YamlFileContentProvider implements YamlFileContentProviderInterface
|
||||
{
|
||||
public function setContent(string $yamlContent): void
|
||||
{
|
||||
}
|
||||
|
||||
public function getYamlContent(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Testing\PhpConfigPrinter\SymfonyVersionFeatureGuard;
|
||||
use Rector\Testing\PhpConfigPrinter\YamlFileContentProvider;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
use Symplify\PhpConfigPrinter\Contract\SymfonyVersionFeatureGuardInterface;
|
||||
use Symplify\PhpConfigPrinter\Contract\YamlFileContentProviderInterface;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->defaults()
|
||||
->autowire()
|
||||
->public()
|
||||
->autoconfigure();
|
||||
|
||||
// only for dev
|
||||
if (interface_exists(SymfonyVersionFeatureGuardInterface::class)) {
|
||||
$services->set(SymfonyVersionFeatureGuard::class);
|
||||
$services->alias(SymfonyVersionFeatureGuardInterface::class, SymfonyVersionFeatureGuard::class);
|
||||
|
||||
$services->set(YamlFileContentProvider::class);
|
||||
$services->alias(YamlFileContentProviderInterface::class, YamlFileContentProvider::class);
|
||||
}
|
||||
};
|
|
@ -16,7 +16,9 @@
|
|||
</testsuites>
|
||||
|
||||
<php>
|
||||
<ini name="memory_limit" value="-1" />
|
||||
<const name="RECTOR_REPOSITORY" value="true"/>
|
||||
<env name="XDEBUG_MODE" value="coverage"/>
|
||||
<env name="KERNEL_CACHE_DIRECTORY" value="tmp/rector/cache"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
|
|
@ -26,7 +26,7 @@ final class ArgumentAdderRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ final class ArgumentDefaultValueReplacerRectorTest extends AbstractRectorTestCas
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ final class SwapFuncCallArgumentsRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ final class RectorOrderTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\Autodiscovery\Rector\FileNode\MoveEntitiesToEntityDirectoryRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Autodiscovery\Rector\FileNode\MoveEntitiesToEntityDirectoryRector;
|
||||
use Rector\FileSystemRector\ValueObject\AddedFileWithContent;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
@ -40,8 +39,8 @@ final class MoveEntitiesToEntityDirectoryRectorTest extends AbstractRectorTestCa
|
|||
];
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return MoveEntitiesToEntityDirectoryRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Autodiscovery\Rector\FileNode\MoveEntitiesToEntityDirectoryRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(MoveEntitiesToEntityDirectoryRector::class);
|
||||
};
|
|
@ -79,7 +79,7 @@ final class MoveInterfacesToContractNamespaceDirectoryRectorTest extends Abstrac
|
|||
yield [new SmartFileInfo(__DIR__ . '/Source/Contract/Foo/KeepThisSomeInterface.php'), null];
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/some_config.php';
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ final class MoveServicesBySuffixToDirectoryRectorTest extends AbstractRectorTest
|
|||
];
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ final class MoveValueObjectsToValueObjectDirectoryRectorTest extends AbstractRec
|
|||
yield [new SmartFileInfo(__DIR__ . '/Source/Utils/SomeSuffixedTest.php.inc'), null];
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CakePHP\Rector\FileWithoutNamespace\ImplicitShortClassNameUseStatementRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CakePHP\Rector\FileWithoutNamespace\ImplicitShortClassNameUseStatementRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ImplicitShortClassNameUseStatementRectorTest extends AbstractRectorT
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ImplicitShortClassNameUseStatementRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CakePHP\Rector\FileWithoutNamespace\ImplicitShortClassNameUseStatementRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ImplicitShortClassNameUseStatementRector::class);
|
||||
};
|
|
@ -26,7 +26,7 @@ final class ArrayToFluentCallRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ final class ModalToGetSetRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ final class RenameMethodCallBasedOnParameterRectorTest extends AbstractRectorTes
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CakePHP\Rector\Namespace_\AppUsesStaticCallToUseStatementRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CakePHP\Rector\Namespace_\AppUsesStaticCallToUseStatementRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class AppUsesStaticCallToUseStatementRectorTest extends AbstractRectorTest
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return AppUsesStaticCallToUseStatementRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CakePHP\Rector\Namespace_\AppUsesStaticCallToUseStatementRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(AppUsesStaticCallToUseStatementRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CakePHP\Rector\Property\ChangeSnakedFixtureNameToPascal;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CakePHP\Rector\Property\ChangeSnakedFixtureNameToPascalRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ChangeSnakedFixtureNameToPascalTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ChangeSnakedFixtureNameToPascalRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CakePHP\Rector\Property\ChangeSnakedFixtureNameToPascalRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ChangeSnakedFixtureNameToPascalRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\Carbon\Rector\MethodCall\ChangeCarbonSingularMethodCallToPluralRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Carbon\Rector\MethodCall\ChangeCarbonSingularMethodCallToPluralRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ChangeCarbonSingularMethodCallToPluralRectorTest extends AbstractRec
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ChangeCarbonSingularMethodCallToPluralRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Carbon\Rector\MethodCall\ChangeCarbonSingularMethodCallToPluralRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ChangeCarbonSingularMethodCallToPluralRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\Carbon\Rector\MethodCall\ChangeDiffForHumansArgsRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Carbon\Rector\MethodCall\ChangeDiffForHumansArgsRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ChangeDiffForHumansArgsRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ChangeDiffForHumansArgsRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Carbon\Rector\MethodCall\ChangeDiffForHumansArgsRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ChangeDiffForHumansArgsRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Array_\ArrayThisCallToThisMethodCallRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Array_\ArrayThisCallToThisMethodCallRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ArrayThisCallToThisMethodCallRectorTest extends AbstractRectorTestCa
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ArrayThisCallToThisMethodCallRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Array_\ArrayThisCallToThisMethodCallRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ArrayThisCallToThisMethodCallRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class CallableThisArrayToAnonymousFunctionRectorTest extends AbstractRecto
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return CallableThisArrayToAnonymousFunctionRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(CallableThisArrayToAnonymousFunctionRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Assign\CombinedAssignRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Assign\CombinedAssignRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -32,8 +31,8 @@ final class CombinedAssignRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return CombinedAssignRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Tests\Transform\Rector\Class_\NativeTestCaseRector\Fixture\SomeRector;
|
||||
use Rector\CodeQuality\Rector\Assign\CombinedAssignRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(SomeRector::class);
|
||||
$services->set(CombinedAssignRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class SplitListAssignToSeparateLineRectorTest extends AbstractRectorTestCa
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return SplitListAssignToSeparateLineRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(SplitListAssignToSeparateLineRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class SimplifyEmptyArrayCheckRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return SimplifyEmptyArrayCheckRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(SimplifyEmptyArrayCheckRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class SimplifyDeMorganBinaryRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return SimplifyDeMorganBinaryRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(SimplifyDeMorganBinaryRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -28,8 +27,8 @@ final class Php8Test extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/FixturePhp8');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ThrowWithPreviousExceptionRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ThrowWithPreviousExceptionRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ThrowWithPreviousExceptionRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ThrowWithPreviousExceptionRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class DateTimeToDateTimeInterfaceRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return DateTimeToDateTimeInterfaceRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -28,8 +27,8 @@ final class Php74Test extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/FixturePhp74');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return DateTimeToDateTimeInterfaceRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(DateTimeToDateTimeInterfaceRector::class);
|
||||
};
|
|
@ -26,7 +26,7 @@ final class CompleteDynamicPropertiesRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function provideConfigFilePath(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/pre_union_types.php';
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class UnionTypeCompleteDynamicPropertiesRectorTest extends AbstractRectorT
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureUnionTypes');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return CompleteDynamicPropertiesRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(CompleteDynamicPropertiesRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Concat\JoinStringConcatRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class JoinStringConcatRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return JoinStringConcatRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(JoinStringConcatRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class UseIdenticalOverEqualWithSameTypeRectorTest extends AbstractRectorTe
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return UseIdenticalOverEqualWithSameTypeRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(UseIdenticalOverEqualWithSameTypeRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class InlineIfToExplicitIfRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return InlineIfToExplicitIfRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(InlineIfToExplicitIfRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ForRepeatedCountToOwnVariableRectorTest extends AbstractRectorTestCa
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ForRepeatedCountToOwnVariableRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ForRepeatedCountToOwnVariableRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\For_\ForToForeachRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\For_\ForToForeachRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ForToForeachRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ForToForeachRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Transform\Rector\Class_\NativeTestCaseRector;
|
||||
use Rector\CodeQuality\Rector\For_\ForToForeachRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(NativeTestCaseRector::class);
|
||||
|
||||
$services->set(ForToForeachRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ForeachItemsAssignToEmptyArrayToAssignRectorTest extends AbstractRec
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ForeachItemsAssignToEmptyArrayToAssignRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ForeachItemsAssignToEmptyArrayToAssignRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Foreach_\ForeachToInArrayRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ForeachToInArrayRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ForeachToInArrayRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ForeachToInArrayRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class SimplifyForeachToArrayFilterRectorTest extends AbstractRectorTestCas
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return SimplifyForeachToArrayFilterRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(SimplifyForeachToArrayFilterRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Foreach_\SimplifyForeachToCoalescingRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToCoalescingRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class SimplifyForeachToCoalescingRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return SimplifyForeachToCoalescingRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToCoalescingRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(SimplifyForeachToCoalescingRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class UnusedForeachValueToArrayKeysRectorTest extends AbstractRectorTestCa
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return UnusedForeachValueToArrayKeysRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(UnusedForeachValueToArrayKeysRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class AddPregQuoteDelimiterRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return AddPregQuoteDelimiterRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(AddPregQuoteDelimiterRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\ArrayKeysAndInArrayToArrayKeyExistsRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\ArrayKeysAndInArrayToArrayKeyExistsRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ArrayKeysAndInArrayToArrayKeyExistsRectorTest extends AbstractRector
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ArrayKeysAndInArrayToArrayKeyExistsRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\ArrayKeysAndInArrayToArrayKeyExistsRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ArrayKeysAndInArrayToArrayKeyExistsRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ArrayMergeOfNonArraysToSimpleArrayRectorTest extends AbstractRectorT
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ArrayMergeOfNonArraysToSimpleArrayRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ArrayMergeOfNonArraysToSimpleArrayRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class ChangeArrayPushToArrayAssignRectorTest extends AbstractRectorTestCas
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return ChangeArrayPushToArrayAssignRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ChangeArrayPushToArrayAssignRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class CompactToVariablesRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return CompactToVariablesRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(CompactToVariablesRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\InArrayAndArrayKeysToArrayKeyExistsRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\InArrayAndArrayKeysToArrayKeyExistsRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class InArrayAndArrayKeysToArrayKeyExistsRectorTest extends AbstractRector
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return InArrayAndArrayKeysToArrayKeyExistsRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\InArrayAndArrayKeysToArrayKeyExistsRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(InArrayAndArrayKeysToArrayKeyExistsRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class IntvalToTypeCastRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return IntvalToTypeCastRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(IntvalToTypeCastRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\IsAWithStringWithThirdArgumentRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\IsAWithStringWithThirdArgumentRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class IsAWithStringWithThirdArgumentRectorTest extends AbstractRectorTestC
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return IsAWithStringWithThirdArgumentRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\IsAWithStringWithThirdArgumentRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(IsAWithStringWithThirdArgumentRector::class);
|
||||
};
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\RemoveSoleValueSprintfRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\CodeQuality\Rector\FuncCall\RemoveSoleValueSprintfRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
|
@ -27,8 +26,8 @@ final class RemoveSoleValueSprintfRectorTest extends AbstractRectorTestCase
|
|||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return RemoveSoleValueSprintfRector::class;
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue