Updated Rector to commit bb384013c3

bb384013c3 [CodeQuality] CodeQuality config set list clean up (#606)
This commit is contained in:
Tomas Votruba 2021-08-06 20:12:05 +00:00
parent 499d6ba043
commit cd8b211b7b
28 changed files with 93 additions and 61 deletions

View File

@ -42,6 +42,7 @@ use Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector;
use Rector\CodeQuality\Rector\FuncCall\UnwrapSprintfOneArgumentRector;
use Rector\CodeQuality\Rector\FunctionLike\RemoveAlwaysTrueConditionSetInConstructorRector;
use Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector;
use Rector\CodeQuality\Rector\Identical\SimplifyArraySearchRector;
use Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector;
@ -72,6 +73,7 @@ use Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector;
use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector;
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\Php52\Rector\Property\VarToPublicPropertyRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
@ -174,4 +176,6 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$services->set(\Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector::class);
$services->set(\Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector::class);
$services->set(\Rector\CodeQuality\Rector\FuncCall\CallUserFuncWithArrowFunctionToInlineRector::class);
$services->set(\Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector::class);
$services->set(\Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class);
};

View File

@ -28,6 +28,10 @@ final class SetList implements \Rector\Set\Contract\SetListInterface
* @var string
*/
public const CODING_STYLE = __DIR__ . '/../../../config/set/coding-style.php';
/**
* @var string
*/
public const CODING_STYLE_ADVANCED = __DIR__ . '/../../../config/set/coding-style-advanced.php';
/**
* @var string
*/

View File

@ -3,6 +3,7 @@
declare (strict_types=1);
namespace Rector\Testing\PHPUnit\Behavior;
use RectorPrefix20210806\Nette\Utils\FileSystem;
use Rector\Core\Exception\ShouldNotHappenException;
use Symplify\SmartFileSystem\SmartFileInfo;
trait MultipleFilesChangedTrait
@ -25,12 +26,12 @@ trait MultipleFilesChangedTrait
if (\trim($expectedContent)) {
$fixtureContent .= $separator . $expectedContent;
}
\file_put_contents($fixturePath, $fixtureContent);
\RectorPrefix20210806\Nette\Utils\FileSystem::write($fixturePath, $fixtureContent);
$newFileInfo = new \Symplify\SmartFileSystem\SmartFileInfo($fixturePath);
$this->doTestFileInfo($newFileInfo, $allowMatches);
$this->checkAdditionalChanges($expectedFileChanges);
if (\file_exists($fixturePath)) {
\unlink($fixturePath);
\RectorPrefix20210806\Nette\Utils\FileSystem::delete($fixturePath);
}
}
/**
@ -49,7 +50,7 @@ trait MultipleFilesChangedTrait
$input = isset($additionalFileChange[1]) ? \trim($additionalFileChange[1]) : null;
if ($input) {
$this->createFixtureDir($fullPath);
\file_put_contents($fullPath, $input);
\RectorPrefix20210806\Nette\Utils\FileSystem::write($fullPath, $input);
}
$expectedFileChanges[$fullPath] = isset($additionalFileChange[2]) ? \trim($additionalFileChange[2]) : '';
}
@ -71,7 +72,7 @@ trait MultipleFilesChangedTrait
$realFileContent = $addedFile ? \trim($addedFile->getFileContent()) : null;
$this->assertSame($expectedFileChange, $realFileContent);
if (\file_exists($path)) {
\unlink($path);
\RectorPrefix20210806\Nette\Utils\FileSystem::delete($path);
}
}
}

View File

@ -11,6 +11,7 @@ use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use Rector\Core\PhpParser\AstResolver;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\PhpParser\Node\Value\ValueResolver;
@ -140,7 +141,7 @@ final class IsClassMethodUsedAnalyzer
}
private function isPrivateAbstractMethodInTrait(\PhpParser\Node\Stmt\ClassMethod $classMethod, ?string $classMethodName) : bool
{
if (null === $classMethodName) {
if ($classMethodName === null) {
return \false;
}
$scope = $classMethod->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
@ -148,7 +149,7 @@ final class IsClassMethodUsedAnalyzer
return \false;
}
$classReflection = $scope->getClassReflection();
if (null === $classReflection) {
if (!$classReflection instanceof \PHPStan\Reflection\ClassReflection) {
return \false;
}
$traits = $this->astResolver->parseClassReflectionTraits($classReflection);

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '45766e1d95f9797040738c8b286312202632ccd4';
public const PACKAGE_VERSION = 'bb384013c3f04d9ae1471fdfa50fbff943b7821c';
/**
* @var string
*/
public const RELEASE_DATE = '2021-08-06 10:39:44';
public const RELEASE_DATE = '2021-08-06 22:01:54';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210806\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8::getLoader();
return ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8
class ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6880bc14858460aa28c80d26ae6211b8::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit53a9a1e26806ec2055a64feafb4f4332::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit6880bc14858460aa28c80d26ae6211b8::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit53a9a1e26806ec2055a64feafb4f4332::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire6880bc14858460aa28c80d26ae6211b8($fileIdentifier, $file);
composerRequire53a9a1e26806ec2055a64feafb4f4332($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire6880bc14858460aa28c80d26ae6211b8($fileIdentifier, $file)
function composerRequire53a9a1e26806ec2055a64feafb4f4332($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit6880bc14858460aa28c80d26ae6211b8
class ComposerStaticInit53a9a1e26806ec2055a64feafb4f4332
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3846,9 +3846,9 @@ class ComposerStaticInit6880bc14858460aa28c80d26ae6211b8
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit6880bc14858460aa28c80d26ae6211b8::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6880bc14858460aa28c80d26ae6211b8::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6880bc14858460aa28c80d26ae6211b8::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit53a9a1e26806ec2055a64feafb4f4332::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit53a9a1e26806ec2055a64feafb4f4332::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit53a9a1e26806ec2055a64feafb4f4332::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1668,17 +1668,17 @@
},
{
"name": "ssch\/typo3-rector",
"version": "v0.11.22",
"version_normalized": "0.11.22.0",
"version": "v0.11.23",
"version_normalized": "0.11.23.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/sabbelasichon\/typo3-rector.git",
"reference": "6a26fcbf5bdbe60b77037f576e86d1c9bc560a87"
"reference": "ebe86cfb57972a9092eb385e5025190c06bbcfc6"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/6a26fcbf5bdbe60b77037f576e86d1c9bc560a87",
"reference": "6a26fcbf5bdbe60b77037f576e86d1c9bc560a87",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/ebe86cfb57972a9092eb385e5025190c06bbcfc6",
"reference": "ebe86cfb57972a9092eb385e5025190c06bbcfc6",
"shasum": ""
},
"require": {
@ -1704,7 +1704,7 @@
"symplify\/rule-doc-generator": "^9.4.22",
"tracy\/tracy": "^2.8"
},
"time": "2021-07-17T17:04:11+00:00",
"time": "2021-08-06T15:18:22+00:00",
"type": "rector-extension",
"extra": {
"rector": {
@ -1736,7 +1736,7 @@
"description": "Instant fixes for your TYPO3 code by using Rector.",
"support": {
"issues": "https:\/\/github.com\/sabbelasichon\/typo3-rector\/issues",
"source": "https:\/\/github.com\/sabbelasichon\/typo3-rector\/tree\/v0.11.22"
"source": "https:\/\/github.com\/sabbelasichon\/typo3-rector\/tree\/v0.11.23"
},
"funding": [
{
@ -1835,12 +1835,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/console.git",
"reference": "77c4d551ec36efc532f026be3970d9641061e3b8"
"reference": "37e6cca375ed4cca2a82c81487cd077520f6cab2"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/77c4d551ec36efc532f026be3970d9641061e3b8",
"reference": "77c4d551ec36efc532f026be3970d9641061e3b8",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/37e6cca375ed4cca2a82c81487cd077520f6cab2",
"reference": "37e6cca375ed4cca2a82c81487cd077520f6cab2",
"shasum": ""
},
"require": {
@ -1878,7 +1878,7 @@
"symfony\/lock": "",
"symfony\/process": ""
},
"time": "2021-08-04T21:20:46+00:00",
"time": "2021-08-04T23:50:27+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
@ -1938,12 +1938,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/dependency-injection.git",
"reference": "5a825e4b386066167a8b55487091cb62beec74c2"
"reference": "a665946279f566d94ed5eb98999cfa65c6fa5a78"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/dependency-injection\/zipball\/5a825e4b386066167a8b55487091cb62beec74c2",
"reference": "5a825e4b386066167a8b55487091cb62beec74c2",
"url": "https:\/\/api.github.com\/repos\/symfony\/dependency-injection\/zipball\/a665946279f566d94ed5eb98999cfa65c6fa5a78",
"reference": "a665946279f566d94ed5eb98999cfa65c6fa5a78",
"shasum": ""
},
"require": {
@ -1976,7 +1976,7 @@
"symfony\/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony\/yaml": ""
},
"time": "2021-07-23T15:55:36+00:00",
"time": "2021-08-02T16:16:27+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
@ -2005,7 +2005,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https:\/\/symfony.com",
"support": {
"source": "https:\/\/github.com\/symfony\/dependency-injection\/tree\/v5.3.4"
"source": "https:\/\/github.com\/symfony\/dependency-injection\/tree\/5.3"
},
"funding": [
{

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.3'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.15'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.5'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.21'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.17'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.22'));
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.3'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.15'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.5'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.21'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.17'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.23'));
private function __construct()
{
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20210806\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8', false) && !interface_exists('ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8', false) && !trait_exists('ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8', false)) {
spl_autoload_call('RectorPrefix20210806\ComposerAutoloaderInit6880bc14858460aa28c80d26ae6211b8');
if (!class_exists('ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332', false) && !interface_exists('ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332', false) && !trait_exists('ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332', false)) {
spl_autoload_call('RectorPrefix20210806\ComposerAutoloaderInit53a9a1e26806ec2055a64feafb4f4332');
}
if (!class_exists('AjaxLogin', false) && !interface_exists('AjaxLogin', false) && !trait_exists('AjaxLogin', false)) {
spl_autoload_call('RectorPrefix20210806\AjaxLogin');
@ -3305,9 +3305,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210806\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire6880bc14858460aa28c80d26ae6211b8')) {
function composerRequire6880bc14858460aa28c80d26ae6211b8() {
return \RectorPrefix20210806\composerRequire6880bc14858460aa28c80d26ae6211b8(...func_get_args());
if (!function_exists('composerRequire53a9a1e26806ec2055a64feafb4f4332')) {
function composerRequire53a9a1e26806ec2055a64feafb4f4332() {
return \RectorPrefix20210806\composerRequire53a9a1e26806ec2055a64feafb4f4332(...func_get_args());
}
}
if (!function_exists('parseArgs')) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,9 @@ declare (strict_types=1);
namespace RectorPrefix20210806;
use Ssch\TYPO3Rector\Rector\v8\v1\Array2XmlCsToArray2XmlRector;
use Ssch\TYPO3Rector\Rector\v8\v1\GeneralUtilityToUpperAndLowerRector;
use Ssch\TYPO3Rector\Rector\v8\v1\RefactorDbConstantsRector;
use Ssch\TYPO3Rector\Rector\v8\v1\RefactorVariousGeneralUtilityMethodsRector;
use Ssch\TYPO3Rector\Rector\v8\v1\TypoScriptFrontendControllerCharsetConverterRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
@ -13,4 +15,6 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$services->set(\Ssch\TYPO3Rector\Rector\v8\v1\RefactorDbConstantsRector::class);
$services->set(\Ssch\TYPO3Rector\Rector\v8\v1\Array2XmlCsToArray2XmlRector::class);
$services->set(\Ssch\TYPO3Rector\Rector\v8\v1\TypoScriptFrontendControllerCharsetConverterRector::class);
$services->set(\Ssch\TYPO3Rector\Rector\v8\v1\GeneralUtilityToUpperAndLowerRector::class);
$services->set(\Ssch\TYPO3Rector\Rector\v8\v1\RefactorVariousGeneralUtilityMethodsRector::class);
};

View File

@ -18,6 +18,7 @@ You can use typo3-rector in various ways:
- add ClassAliasMap in case you're upgrading 2 versions to provide old classes to migrate
- apply rulesets stepwise by version; first TCA only, then full set or combined
- apply rulesets stepwise to your packages or multiple packages at once
- don't use class aliases for Nimut Testing Framework
### Starting
Starting with an upgrade should start with installing typo3-rector and checking for the rector rules/sets of your current version, not the one you're targeting.
@ -72,6 +73,23 @@ Both of that is reason to gather multiple packages for a combined TCA run with t
__DIR__ . '/packages/package_thirdone',
]);
```
### Migrating Testing Framework
Do not use any class alias like
```php
use Nimut\TestingFramework\TestCase\FunctionalTestCase as TestCase;
abstract class AbstractContentElement extends TestCase
```
This will only work partially, resolve them beforehand:
```php
use Nimut\TestingFramework\TestCase\FunctionalTestCase;
abstract class AbstractContentElement extends FunctionalTestCase
```
---
**Be aware!**

View File

@ -16,7 +16,7 @@ final class DefaultSwitchFluidRector implements \Ssch\TYPO3Rector\Contract\FileP
/**
* @var string
*/
private const PATTERN = '#<f:case default="(1|true)">(.*)</f:case>#';
private const PATTERN = '#<f:case default="(1|true)">(.*)<\\/f:case>#imsU';
/**
* @var string
*/

View File

@ -3,7 +3,7 @@
declare (strict_types=1);
namespace Ssch\TYPO3Rector\Helper;
use UnexpectedValueException;
use InvalidArgumentException;
final class ArrayUtility
{
/**
@ -11,10 +11,10 @@ final class ArrayUtility
*/
public static function trimExplode(string $delimiter, string $string, bool $removeEmptyValues = \false, int $limit = 0) : array
{
$result = \explode($delimiter, $string);
if (\false === $result) {
throw new \UnexpectedValueException(\sprintf('String %s could not be exploded by %s', $string, $delimiter));
if ('' === $delimiter) {
throw new \InvalidArgumentException('Please define a correct delimiter');
}
$result = \explode($delimiter, $string);
if ($removeEmptyValues) {
$temp = [];
foreach ($result as $value) {

View File

@ -15,7 +15,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class MoveLanguageFilesFromLocallangToResourcesRector extends \Rector\Core\Rector\AbstractRector
{
/**
* @var string[]
* @var array<string, string>
*/
private const MAPPING_OLD_TO_NEW_PATHS = ['LLL:EXT:lang/locallang_alt_doc.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_alt_doc.xlf', 'LLL:EXT:lang/locallang_alt_intro.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_alt_intro.xlf', 'LLL:EXT:lang/locallang_browse_links.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf', 'LLL:EXT:lang/locallang_common.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_common.xlf', 'LLL:EXT:lang/locallang_core.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf', 'LLL:EXT:lang/locallang_csh_be_groups.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_be_groups.xlf', 'LLL:EXT:lang/locallang_csh_be_users.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_be_users.xlf', 'LLL:EXT:lang/locallang_csh_corebe.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_corebe.xlf', 'LLL:EXT:lang/locallang_csh_pages.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_pages.xlf', 'LLL:EXT:lang/locallang_csh_sysfilem.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_sysfilem.xlf', 'LLL:EXT:lang/locallang_csh_syslang.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_syslang.xlf', 'LLL:EXT:lang/locallang_csh_sysnews.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_sysnews.xlf', 'LLL:EXT:lang/locallang_csh_web_func.xlf' => 'func/Resources/Private/Language/locallang_csh_web_func.xlf', 'LLL:EXT:lang/locallang_csh_web_info.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_csh_web_info.xlf', 'LLL:EXT:lang/locallang_general.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf', 'LLL:EXT:lang/locallang_general.xml' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf', 'LLL:EXT:lang/locallang_general.php' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf', 'LLL:EXT:lang/locallang_login.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_login.xlf', 'LLL:EXT:lang/locallang_misc.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_misc.xlf', 'LLL:EXT:lang/locallang_mod_admintools.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_admintools.xlf', 'LLL:EXT:lang/locallang_mod_file_list.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_file_list.xlf', 'LLL:EXT:lang/locallang_mod_file.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_file.xlf', 'LLL:EXT:lang/locallang_mod_help_about.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_help_about.xlf', 'LLL:EXT:lang/locallang_mod_help_cshmanual.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_help_cshmanual.xlf', 'LLL:EXT:lang/locallang_mod_help.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_help.xlf', 'LLL:EXT:lang/locallang_mod_system.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_system.xlf', 'LLL:EXT:lang/locallang_mod_usertools.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_usertools.xlf', 'LLL:EXT:lang/locallang_mod_user_ws.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_user_ws.xlf', 'LLL:EXT:lang/locallang_mod_web_func.xlf' => 'LLL:EXT:func/Resources/Private/Language/locallang_mod_web_func.xlf', 'LLL:EXT:lang/locallang_mod_web_info.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_web_info.xlf', 'LLL:EXT:lang/locallang_mod_web_list.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_web_list.xlf', 'LLL:EXT:lang/locallang_mod_web.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_mod_web.xlf', 'LLL:EXT:lang/locallang_show_rechis.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_show_rechis.xlf', 'LLL:EXT:lang/locallang_t3lib_fullsearch.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_t3lib_fullsearch.xlf', 'LLL:EXT:lang/locallang_tca.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf', 'LLL:EXT:lang/locallang_tcemain.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_tcemain.xlf', 'LLL:EXT:lang/locallang_tsfe.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_tsfe.xlf', 'LLL:EXT:lang/locallang_tsparser.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_tsparser.xlf', 'LLL:EXT:lang/locallang_view_help.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_view_help.xlf', 'LLL:EXT:lang/locallang_wizards.xlf' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf'];
/**

View File

@ -15,7 +15,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class MoveLanguageFilesFromExtensionLangRector extends \Rector\Core\Rector\AbstractRector
{
/**
* @var string[]
* @var array<string, string>
*/
private const MAPPING_OLD_TO_NEW_PATHS = ['lang/Resources/Private/Language/locallang_alt_intro.xlf' => 'about/Resources/Private/Language/Modules/locallang_alt_intro.xlf', 'lang/Resources/Private/Language/locallang_alt_doc.xlf' => 'backend/Resources/Private/Language/locallang_alt_doc.xlf', 'lang/Resources/Private/Language/locallang_login.xlf' => 'backend/Resources/Private/Language/locallang_login.xlf', 'lang/Resources/Private/Language/locallang_common.xlf' => 'core/Resources/Private/Language/locallang_common.xlf', 'lang/Resources/Private/Language/locallang_core.xlf' => 'core/Resources/Private/Language/locallang_core.xlf', 'lang/Resources/Private/Language/locallang_general.xlf' => 'core/Resources/Private/Language/locallang_general.xlf', 'lang/Resources/Private/Language/locallang_misc.xlf' => 'core/Resources/Private/Language/locallang_misc.xlf', 'lang/Resources/Private/Language/locallang_mod_web_list.xlf' => 'core/Resources/Private/Language/locallang_mod_web_list.xlf', 'lang/Resources/Private/Language/locallang_tca.xlf' => 'core/Resources/Private/Language/locallang_tca.xlf', 'lang/Resources/Private/Language/locallang_tsfe.xlf' => 'core/Resources/Private/Language/locallang_tsfe.xlf', 'lang/Resources/Private/Language/locallang_wizards.xlf' => 'core/Resources/Private/Language/locallang_wizards.xlf', 'lang/Resources/Private/Language/locallang_browse_links.xlf' => 'recordlist/Resources/Private/Language/locallang_browse_links.xlf', 'lang/Resources/Private/Language/locallang_tcemain.xlf' => 'workspaces/Resources/Private/Language/locallang_tcemain.xlf'];
/**

View File

@ -99,7 +99,7 @@ CODE_SAMPLE
private function createPropertyAnnotation(string $validatorAnnotation) : \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode
{
if (\strpos($validatorAnnotation, '(') !== \false) {
\preg_match_all('#(?P<validatorName>.*)\\((?P<validatorOptions>.*)\\)#', $validatorAnnotation, $matches);
\preg_match_all('#(?P<validatorName>.*)(?<=[\\w])\\((?P<validatorOptions>.*)\\)#', $validatorAnnotation, $matches);
$validator = $matches['validatorName'][0];
$options = $matches['validatorOptions'][0];
\preg_match_all('#\\s*(?P<optionName>[a-z0-9]+)\\s*=\\s*(?P<optionValue>"(?:"|[^"])*"|\'(?:\\\\\'|[^\'])*\'|(?:\\s|[^,"\']*))#ixS', $options, $optionNamesValues);

View File

@ -17,7 +17,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class SystemEnvironmentBuilderConstantsRector extends \Rector\Core\Rector\AbstractRector
{
/**
* @var string[]
* @var array<string, string>
*/
private const MAP_CONSTANTS_TO_STRING = ['TYPO3_URL_MAILINGLISTS' => 'http://lists.typo3.org/cgi-bin/mailman/listinfo', 'TYPO3_URL_DOCUMENTATION' => 'https://typo3.org/documentation/', 'TYPO3_URL_DOCUMENTATION_TSREF' => 'https://docs.typo3.org/typo3cms/TyposcriptReference/', 'TYPO3_URL_DOCUMENTATION_TSCONFIG' => 'https://docs.typo3.org/typo3cms/TSconfigReference/', 'TYPO3_URL_CONSULTANCY' => 'https://typo3.org/support/professional-services/', 'TYPO3_URL_CONTRIBUTE' => 'https://typo3.org/contribute/', 'TYPO3_URL_SECURITY' => 'https://typo3.org/teams/security/', 'TYPO3_URL_DOWNLOAD' => 'https://typo3.org/download/', 'TYPO3_URL_SYSTEMREQUIREMENTS' => 'https://typo3.org/typo3-cms/overview/requirements/', 'TAB' => "\t", 'NUL' => "\0", 'SUB' => '26', 'T3_ERR_SV_GENERAL' => 'ERROR_GENERAL', 'T3_ERR_SV_NOT_AVAIL' => 'ERROR_SERVICE_NOT_AVAILABLE', 'T3_ERR_SV_WRONG_SUBTYPE' => 'ERROR_WRONG_SUBTYPE', 'T3_ERR_SV_NO_INPUT' => 'ERROR_NO_INPUT', 'T3_ERR_SV_FILE_NOT_FOUND' => 'ERROR_FILE_NOT_FOUND', 'T3_ERR_SV_FILE_READ' => 'ERROR_FILE_NOT_READABLE', 'T3_ERR_SV_FILE_WRITE' => 'ERROR_FILE_NOT_WRITEABLE', 'T3_ERR_SV_PROG_NOT_FOUND' => 'ERROR_PROGRAM_NOT_FOUND', 'T3_ERR_SV_PROG_FAILED' => 'ERROR_PROGRAM_FAILED'];
/**

View File

@ -8,7 +8,7 @@ use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\PostRector\Rector\NameImportingPostRector;
use Ssch\TYPO3Rector\Configuration\Typo3Option;
use Ssch\TYPO3Rector\FileProcessor\Composer\Rector\ExtensionComposerRector;
use Ssch\TYPO3Rector\FileProcessor\TypoScript\Visitors\FileIncludeToImportStatementVisitor;
use Ssch\TYPO3Rector\FileProcessor\TypoScript\Rector\FileIncludeToImportStatementTypoScriptRector;
use Ssch\TYPO3Rector\Rector\v9\v0\InjectAnnotationRector;
use Ssch\TYPO3Rector\Rector\General\ConvertTypo3ConfVarsRector;
use Ssch\TYPO3Rector\Rector\General\ExtEmConfRector;
@ -111,5 +111,5 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$services->set(ExtensionComposerRector::class);
// Do you want to modernize your TypoScript include statements for files and move from <INCLUDE /> to @import use the FileIncludeToImportStatementVisitor
// $services->set(FileIncludeToImportStatementVisitor::class);
// $services->set(FileIncludeToImportStatementTypoScriptRector::class);
};

View File

@ -147,7 +147,7 @@ abstract class Helper implements \RectorPrefix20210806\Symfony\Component\Console
// remove <...> formatting
$string = $formatter->format($string ?? '');
// remove already formatted characters
$string = \preg_replace("/\33\\[[^m]*m/", '', $string);
$string = \preg_replace("/\33\\[[^m]*m/", '', $string ?? '');
$formatter->setDecorated($isDecorated);
return $string;
}

View File

@ -35,7 +35,7 @@ class PassConfig
{
$this->mergePass = new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass();
$this->beforeOptimizationPasses = [100 => [new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveClassPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\RegisterAutoconfigureAttributesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AttributeAutoconfigurationPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\RegisterEnvVarProcessorsPass()], -1000 => [new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ExtensionCompilerPass()]];
$this->optimizationPasses = [[new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveDecoratorStackPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\RegisterServiceSubscribersPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass(\false, \false), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveFactoryClassPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveNamedArgumentsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutowireRequiredPropertiesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckDefinitionValidityPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutowirePass(\false), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveTaggedIteratorArgumentPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveServiceSubscribersPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass(\true), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckArgumentsValidityPass(\false)]];
$this->optimizationPasses = [[new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveDecoratorStackPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\RegisterServiceSubscribersPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass(\false, \false), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveFactoryClassPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveNamedArgumentsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutowireRequiredPropertiesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckDefinitionValidityPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AutowirePass(\false), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveTaggedIteratorArgumentPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveServiceSubscribersPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass(\true), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckArgumentsValidityPass(\false)]];
$this->removingPasses = [[new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass(new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass()), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass()]];
$this->afterRemovingPasses = [[new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveHotPathPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\ResolveNoPreloadPass(), new \RectorPrefix20210806\Symfony\Component\DependencyInjection\Compiler\AliasDeprecatedPublicServicesPass()]];
}