Updated Rector to commit 1691157a64

1691157a64 [Core] Use PropertyFetchAnalyzer::isFilledViaMethodCallInConstructStmts() in ConstructorAssignDetector::isPropertyAssigned() (#2351)
This commit is contained in:
Tomas Votruba 2022-05-23 14:15:07 +00:00
parent bb3b32dd59
commit edbab99c60
20 changed files with 252 additions and 81 deletions

View File

@ -6,6 +6,7 @@ namespace Rector\Php71\NodeAnalyzer;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\ClassLike;
use PHPStan\Analyser\Scope;
@ -41,39 +42,40 @@ final class CountableAnalyzer
* @var \PHPStan\Reflection\ReflectionProvider
*/
private $reflectionProvider;
/**
* @readonly
* @var \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer
*/
private $propertyFetchAnalyzer;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer
*/
private $propertyFetchAnalyzer;
/**
* @readonly
* @var \Rector\TypeDeclaration\AlreadyAssignDetector\ConstructorAssignDetector
*/
private $constructorAssignDetector;
public function __construct(\Rector\NodeTypeResolver\NodeTypeResolver $nodeTypeResolver, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \PHPStan\Reflection\ReflectionProvider $reflectionProvider, \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer $propertyFetchAnalyzer, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\TypeDeclaration\AlreadyAssignDetector\ConstructorAssignDetector $constructorAssignDetector)
public function __construct(\Rector\NodeTypeResolver\NodeTypeResolver $nodeTypeResolver, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \PHPStan\Reflection\ReflectionProvider $reflectionProvider, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer $propertyFetchAnalyzer, \Rector\TypeDeclaration\AlreadyAssignDetector\ConstructorAssignDetector $constructorAssignDetector)
{
$this->nodeTypeResolver = $nodeTypeResolver;
$this->nodeNameResolver = $nodeNameResolver;
$this->reflectionProvider = $reflectionProvider;
$this->propertyFetchAnalyzer = $propertyFetchAnalyzer;
$this->betterNodeFinder = $betterNodeFinder;
$this->propertyFetchAnalyzer = $propertyFetchAnalyzer;
$this->constructorAssignDetector = $constructorAssignDetector;
}
public function isCastableArrayType(\PhpParser\Node\Expr $expr, \PHPStan\Type\ArrayType $arrayType) : bool
{
if (!$expr instanceof \PhpParser\Node\Expr\PropertyFetch) {
if (!$this->propertyFetchAnalyzer->isPropertyFetch($expr)) {
return \false;
}
if ($arrayType instanceof \PHPStan\Type\Constant\ConstantArrayType) {
return \false;
}
$callerObjectType = $this->nodeTypeResolver->getType($expr->var);
/** @var StaticPropertyFetch|PropertyFetch $expr */
$callerObjectType = $expr instanceof \PhpParser\Node\Expr\StaticPropertyFetch ? $this->nodeTypeResolver->getType($expr->class) : $this->nodeTypeResolver->getType($expr->var);
$propertyName = $this->nodeNameResolver->getName($expr->name);
if (!\is_string($propertyName)) {
return \false;
@ -102,9 +104,6 @@ final class CountableAnalyzer
if ($this->isIterableOrFilledAtConstruct($nativeType, $expr)) {
return \false;
}
if ($this->propertyFetchAnalyzer->isFilledViaMethodCallInConstructStmts($expr)) {
return \false;
}
$propertyDefaultValue = $propertiesDefaults[$propertyName];
return $propertyDefaultValue === null;
}
@ -115,7 +114,10 @@ final class CountableAnalyzer
}
return \is_a($typeWithClassName->getClassName(), \PhpParser\Node\Expr\Array_::class, \true);
}
private function isIterableOrFilledAtConstruct(\PHPStan\Type\Type $nativeType, \PhpParser\Node\Expr\PropertyFetch $propertyFetch) : bool
/**
* @param \PhpParser\Node\Expr\StaticPropertyFetch|\PhpParser\Node\Expr\PropertyFetch $propertyFetch
*/
private function isIterableOrFilledAtConstruct(\PHPStan\Type\Type $nativeType, $propertyFetch) : bool
{
if ($nativeType->isIterable()->yes()) {
return \true;
@ -130,7 +132,10 @@ final class CountableAnalyzer
$propertyName = (string) $this->nodeNameResolver->getName($propertyFetch->name);
return $this->constructorAssignDetector->isPropertyAssigned($classLike, $propertyName);
}
private function resolveProperty(\PhpParser\Node\Expr\PropertyFetch $propertyFetch, \PHPStan\Reflection\ClassReflection $classReflection, string $propertyName) : ?\PHPStan\Reflection\PropertyReflection
/**
* @param \PhpParser\Node\Expr\StaticPropertyFetch|\PhpParser\Node\Expr\PropertyFetch $propertyFetch
*/
private function resolveProperty($propertyFetch, \PHPStan\Reflection\ClassReflection $classReflection, string $propertyName) : ?\PHPStan\Reflection\PropertyReflection
{
$scope = $propertyFetch->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
if (!$scope instanceof \PHPStan\Analyser\Scope) {

View File

@ -11,6 +11,7 @@ use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
use PhpParser\NodeTraverser;
use PHPStan\Type\ObjectType;
use Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer;
use Rector\Core\ValueObject\MethodName;
use Rector\NodeTypeResolver\NodeTypeResolver;
use Rector\TypeDeclaration\Matcher\PropertyAssignMatcher;
@ -42,12 +43,18 @@ final class ConstructorAssignDetector
* @var \Rector\TypeDeclaration\NodeAnalyzer\AutowiredClassMethodOrPropertyAnalyzer
*/
private $autowiredClassMethodOrPropertyAnalyzer;
public function __construct(\Rector\NodeTypeResolver\NodeTypeResolver $nodeTypeResolver, \Rector\TypeDeclaration\Matcher\PropertyAssignMatcher $propertyAssignMatcher, \RectorPrefix20220523\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\TypeDeclaration\NodeAnalyzer\AutowiredClassMethodOrPropertyAnalyzer $autowiredClassMethodOrPropertyAnalyzer)
/**
* @readonly
* @var \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer
*/
private $propertyFetchAnalyzer;
public function __construct(\Rector\NodeTypeResolver\NodeTypeResolver $nodeTypeResolver, \Rector\TypeDeclaration\Matcher\PropertyAssignMatcher $propertyAssignMatcher, \RectorPrefix20220523\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\TypeDeclaration\NodeAnalyzer\AutowiredClassMethodOrPropertyAnalyzer $autowiredClassMethodOrPropertyAnalyzer, \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer $propertyFetchAnalyzer)
{
$this->nodeTypeResolver = $nodeTypeResolver;
$this->propertyAssignMatcher = $propertyAssignMatcher;
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
$this->autowiredClassMethodOrPropertyAnalyzer = $autowiredClassMethodOrPropertyAnalyzer;
$this->propertyFetchAnalyzer = $propertyFetchAnalyzer;
}
public function isPropertyAssigned(\PhpParser\Node\Stmt\ClassLike $classLike, string $propertyName) : bool
{
@ -74,6 +81,9 @@ final class ConstructorAssignDetector
return \PhpParser\NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
});
}
if (!$isAssignedInConstructor) {
return $this->propertyFetchAnalyzer->isFilledViaMethodCallInConstructStmts($classLike, $propertyName);
}
return $isAssignedInConstructor;
}
private function matchAssignExprToPropertyName(\PhpParser\Node $node, string $propertyName) : ?\PhpParser\Node\Expr

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '0.13.0';
public const PACKAGE_VERSION = '1691157a6414c8494065c5ddde64168ac2f8da93';
/**
* @var string
*/
public const RELEASE_DATE = '2022-05-23 03:43:42';
public const RELEASE_DATE = '2022-05-23 21:06:50';
/**
* @var string
*/

View File

@ -7,15 +7,18 @@ use PhpParser\Node;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Trait_;
use PHPStan\Type\ObjectType;
use Rector\Core\Enum\ObjectReference;
use Rector\Core\PhpParser\AstResolver;
use Rector\Core\PhpParser\Comparing\NodeComparator;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\ValueObject\MethodName;
use Rector\NodeNameResolver\NodeNameResolver;
@ -35,21 +38,15 @@ final class PropertyFetchAnalyzer
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\Core\PhpParser\Comparing\NodeComparator
*/
private $nodeComparator;
/**
* @readonly
* @var \Rector\Core\PhpParser\AstResolver
*/
private $astResolver;
public function __construct(\Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\Core\PhpParser\Comparing\NodeComparator $nodeComparator, \Rector\Core\PhpParser\AstResolver $astResolver)
public function __construct(\Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\Core\PhpParser\AstResolver $astResolver)
{
$this->nodeNameResolver = $nodeNameResolver;
$this->betterNodeFinder = $betterNodeFinder;
$this->nodeComparator = $nodeComparator;
$this->astResolver = $astResolver;
}
public function isLocalPropertyFetch(\PhpParser\Node $node) : bool
@ -64,7 +61,7 @@ final class PropertyFetchAnalyzer
if (!$node->class instanceof \PhpParser\Node\Name) {
return \false;
}
return $this->nodeNameResolver->isName($node->class, \Rector\Core\Enum\ObjectReference::SELF()->getValue());
return $this->nodeNameResolver->isNames($node->class, [\Rector\Core\Enum\ObjectReference::SELF()->getValue(), \Rector\Core\Enum\ObjectReference::STATIC()->getValue()]);
}
return \false;
}
@ -129,34 +126,34 @@ final class PropertyFetchAnalyzer
}
return $this->isLocalPropertyFetch($node->var);
}
public function isFilledViaMethodCallInConstructStmts(\PhpParser\Node\Expr\PropertyFetch $propertyFetch) : bool
public function isFilledViaMethodCallInConstructStmts(\PhpParser\Node\Stmt\ClassLike $classLike, string $propertyName) : bool
{
$class = $this->betterNodeFinder->findParentType($propertyFetch, \PhpParser\Node\Stmt\Class_::class);
if (!$class instanceof \PhpParser\Node\Stmt\Class_) {
$classMethod = $classLike->getMethod(\Rector\Core\ValueObject\MethodName::CONSTRUCT);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \false;
}
$construct = $class->getMethod(\Rector\Core\ValueObject\MethodName::CONSTRUCT);
if (!$construct instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \false;
}
/** @var MethodCall[] $methodCalls */
$methodCalls = $this->betterNodeFinder->findInstancesOfInFunctionLikeScoped($construct, [\PhpParser\Node\Expr\MethodCall::class]);
foreach ($methodCalls as $methodCall) {
if (!$methodCall->var instanceof \PhpParser\Node\Expr\Variable) {
$className = (string) $this->nodeNameResolver->getName($classLike);
$stmts = (array) $classMethod->stmts;
foreach ($stmts as $stmt) {
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
continue;
}
if (!$this->nodeNameResolver->isName($methodCall->var, self::THIS)) {
if (!$stmt->expr instanceof \PhpParser\Node\Expr\MethodCall && !$stmt->expr instanceof \PhpParser\Node\Expr\StaticCall) {
continue;
}
$classMethod = $this->astResolver->resolveClassMethodFromMethodCall($methodCall);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
$callerClassMethod = $this->astResolver->resolveClassMethodFromCall($stmt->expr);
if (!$callerClassMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
continue;
}
$isFound = $this->isPropertyAssignFoundInClassMethod($classMethod, $propertyFetch);
if (!$isFound) {
$callerClass = $this->betterNodeFinder->findParentType($callerClassMethod, \PhpParser\Node\Stmt\Class_::class);
if (!$callerClass instanceof \PhpParser\Node\Stmt\Class_) {
continue;
}
return \true;
$callerClassName = (string) $this->nodeNameResolver->getName($callerClass);
$isFound = $this->isPropertyAssignFoundInClassMethod($classLike, $className, $callerClassName, $callerClassMethod, $propertyName);
if ($isFound) {
return \true;
}
}
return \false;
}
@ -171,16 +168,26 @@ final class PropertyFetchAnalyzer
/** @var PropertyFetch $node */
return $this->nodeNameResolver->isNames($node->name, $propertyNames);
}
private function isPropertyAssignFoundInClassMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod, \PhpParser\Node\Expr\PropertyFetch $propertyFetch) : bool
private function isPropertyAssignFoundInClassMethod(\PhpParser\Node\Stmt\ClassLike $classLike, string $className, string $callerClassName, \PhpParser\Node\Stmt\ClassMethod $classMethod, string $propertyName) : bool
{
return (bool) $this->betterNodeFinder->findFirstInFunctionLikeScoped($classMethod, function (\PhpParser\Node $subNode) use($propertyFetch) : bool {
if (!$subNode instanceof \PhpParser\Node\Expr\Assign) {
if ($className !== $callerClassName && !$classLike instanceof \PhpParser\Node\Stmt\Trait_) {
$objectType = new \PHPStan\Type\ObjectType($className);
$callerObjectType = new \PHPStan\Type\ObjectType($callerClassName);
if (!$callerObjectType->isSuperTypeOf($objectType)->yes()) {
return \false;
}
if (!$subNode->var instanceof \PhpParser\Node\Expr\PropertyFetch) {
return \false;
}
foreach ((array) $classMethod->stmts as $stmt) {
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
continue;
}
return $this->nodeComparator->areNodesEqual($propertyFetch, $subNode->var);
});
if (!$stmt->expr instanceof \PhpParser\Node\Expr\Assign) {
continue;
}
if ($this->isLocalPropertyFetchName($stmt->expr->var, $propertyName)) {
return \true;
}
}
return \false;
}
}

View File

@ -200,10 +200,6 @@ final class AstResolver
}
return $classMethod;
}
public function resolveClassMethodFromMethodCall(\PhpParser\Node\Expr\MethodCall $methodCall) : ?\PhpParser\Node\Stmt\ClassMethod
{
return $this->resolveClassMethodFromCall($methodCall);
}
/**
* @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall $call
*/

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a::getLoader();
return ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5::getLoader();

View File

@ -3217,6 +3217,7 @@ return array(
'Ssch\\TYPO3Rector\\Configuration\\Typo3Option' => $vendorDir . '/ssch/typo3-rector/src/Configuration/Typo3Option.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\FlexForms\\Rector\\FlexFormRectorInterface' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/FlexForms/Rector/FlexFormRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Fluid\\Rector\\FluidRectorInterface' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/Fluid/Rector/FluidRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Resources\\FileRectorInterface' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/Resources/FileRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Resources\\IconRectorInterface' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/Resources/IconRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\TypoScript\\Conditions\\TyposcriptConditionMatcher' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/TypoScript/Conditions/TyposcriptConditionMatcher.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\TypoScript\\ConvertToPhpFileInterface' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/TypoScript/ConvertToPhpFileInterface.php',
@ -3231,6 +3232,8 @@ return array(
'Ssch\\TYPO3Rector\\FileProcessor\\FlexForms\\Rector\\RenderTypeFlexFormRector' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/FlexForms/Rector/RenderTypeFlexFormRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Fluid\\FluidFileProcessor' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/Fluid/FluidFileProcessor.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Fluid\\Rector\\DefaultSwitchFluidRector' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/Fluid/Rector/DefaultSwitchFluidRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Files\\ExtTypoScriptFileProcessor' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/Resources/Files/ExtTypoScriptFileProcessor.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Files\\Rector\\RenameExtTypoScriptFilesFileRector' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/Resources/Files/Rector/RenameExtTypoScriptFilesFileRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Icons\\IconsFileProcessor' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/Resources/Icons/IconsFileProcessor.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Icons\\Rector\\IconsRector' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/Resources/Icons/Rector/IconsRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\TypoScript\\Conditions\\AbstractGlobalConditionMatcher' => $vendorDir . '/ssch/typo3-rector/src/FileProcessor/TypoScript/Conditions/AbstractGlobalConditionMatcher.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a
class ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit9644bfdcbb2fb572eba1c3359a3c7cc5::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit9644bfdcbb2fb572eba1c3359a3c7cc5::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire744d3d7732087d9ef2ebd27c38ce378a($fileIdentifier, $file);
composerRequire9644bfdcbb2fb572eba1c3359a3c7cc5($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a
* @param string $file
* @return void
*/
function composerRequire744d3d7732087d9ef2ebd27c38ce378a($fileIdentifier, $file)
function composerRequire9644bfdcbb2fb572eba1c3359a3c7cc5($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a
class ComposerStaticInit9644bfdcbb2fb572eba1c3359a3c7cc5
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3586,6 +3586,7 @@ class ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a
'Ssch\\TYPO3Rector\\Configuration\\Typo3Option' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Configuration/Typo3Option.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\FlexForms\\Rector\\FlexFormRectorInterface' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/FlexForms/Rector/FlexFormRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Fluid\\Rector\\FluidRectorInterface' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/Fluid/Rector/FluidRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Resources\\FileRectorInterface' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/Resources/FileRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Resources\\IconRectorInterface' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/Resources/IconRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\TypoScript\\Conditions\\TyposcriptConditionMatcher' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/TypoScript/Conditions/TyposcriptConditionMatcher.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\TypoScript\\ConvertToPhpFileInterface' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/TypoScript/ConvertToPhpFileInterface.php',
@ -3600,6 +3601,8 @@ class ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a
'Ssch\\TYPO3Rector\\FileProcessor\\FlexForms\\Rector\\RenderTypeFlexFormRector' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/FlexForms/Rector/RenderTypeFlexFormRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Fluid\\FluidFileProcessor' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/Fluid/FluidFileProcessor.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Fluid\\Rector\\DefaultSwitchFluidRector' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/Fluid/Rector/DefaultSwitchFluidRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Files\\ExtTypoScriptFileProcessor' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/Resources/Files/ExtTypoScriptFileProcessor.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Files\\Rector\\RenameExtTypoScriptFilesFileRector' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/Resources/Files/Rector/RenameExtTypoScriptFilesFileRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Icons\\IconsFileProcessor' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/Resources/Icons/IconsFileProcessor.php',
'Ssch\\TYPO3Rector\\FileProcessor\\Resources\\Icons\\Rector\\IconsRector' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/Resources/Icons/Rector/IconsRector.php',
'Ssch\\TYPO3Rector\\FileProcessor\\TypoScript\\Conditions\\AbstractGlobalConditionMatcher' => __DIR__ . '/..' . '/ssch/typo3-rector/src/FileProcessor/TypoScript/Conditions/AbstractGlobalConditionMatcher.php',
@ -3909,9 +3912,9 @@ class ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit744d3d7732087d9ef2ebd27c38ce378a::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit9644bfdcbb2fb572eba1c3359a3c7cc5::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit9644bfdcbb2fb572eba1c3359a3c7cc5::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit9644bfdcbb2fb572eba1c3359a3c7cc5::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2706,7 +2706,7 @@
"description": "Rector upgrades rules for Symfony Framework",
"support": {
"issues": "https:\/\/github.com\/rectorphp\/rector-symfony\/issues",
"source": "https:\/\/github.com\/rectorphp\/rector-symfony\/tree\/main"
"source": "https:\/\/github.com\/rectorphp\/rector-symfony\/tree\/0.12.1"
},
"install-path": "..\/rector\/rector-symfony"
},
@ -2786,12 +2786,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/sabbelasichon\/typo3-rector.git",
"reference": "e34d2fb760d85c4da2a26e9ec62792ed2dd769e6"
"reference": "244ad9b967f54950d50d2b678e1f6f35437e1929"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/e34d2fb760d85c4da2a26e9ec62792ed2dd769e6",
"reference": "e34d2fb760d85c4da2a26e9ec62792ed2dd769e6",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/244ad9b967f54950d50d2b678e1f6f35437e1929",
"reference": "244ad9b967f54950d50d2b678e1f6f35437e1929",
"shasum": ""
},
"require": {
@ -2821,7 +2821,7 @@
"symplify\/vendor-patches": "^10.2",
"tracy\/tracy": "^2.8"
},
"time": "2022-05-22T21:37:02+00:00",
"time": "2022-05-23T12:38:12+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

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' => 'dev-main 43ca394'), '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' => 'dev-main 4a907ed'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 784271e'), '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' => 'dev-main 2e0f600'), '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' => 'dev-main 5f84d90'), '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' => 'dev-main e544f2a'), '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' => 'dev-main 5a33940'), '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' => 'dev-main 6e0ca50'), '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' => 'dev-main e34d2fb'));
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' => 'dev-main 43ca394'), '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' => 'dev-main 4a907ed'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 784271e'), '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' => 'dev-main 2e0f600'), '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' => 'dev-main 5f84d90'), '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' => 'dev-main e544f2a'), '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' => 'dev-main 5a33940'), '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' => 'dev-main 6e0ca50'), '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' => 'dev-main 244ad9b'));
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('RectorPrefix20220523\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a', false) && !interface_exists('ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a', false) && !trait_exists('ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a', false)) {
spl_autoload_call('RectorPrefix20220523\ComposerAutoloaderInit744d3d7732087d9ef2ebd27c38ce378a');
if (!class_exists('ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5', false) && !interface_exists('ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5', false) && !trait_exists('ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5', false)) {
spl_autoload_call('RectorPrefix20220523\ComposerAutoloaderInit9644bfdcbb2fb572eba1c3359a3c7cc5');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220523\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220523\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire744d3d7732087d9ef2ebd27c38ce378a')) {
function composerRequire744d3d7732087d9ef2ebd27c38ce378a() {
return \RectorPrefix20220523\composerRequire744d3d7732087d9ef2ebd27c38ce378a(...func_get_args());
if (!function_exists('composerRequire9644bfdcbb2fb572eba1c3359a3c7cc5')) {
function composerRequire9644bfdcbb2fb572eba1c3359a3c7cc5() {
return \RectorPrefix20220523\composerRequire9644bfdcbb2fb572eba1c3359a3c7cc5(...func_get_args());
}
}
if (!function_exists('scanPath')) {

View File

@ -21,7 +21,7 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$containerConfigurator->import(__DIR__ . '/../utils/**/config/config.php', null, \true);
$services = $containerConfigurator->services();
$services->defaults()->public()->autowire();
$services->load('Ssch\\TYPO3Rector\\', __DIR__ . '/../src')->exclude([__DIR__ . '/../src/Rector', __DIR__ . '/../src/Set', __DIR__ . '/../src/ValueObject', __DIR__ . '/../src/FileProcessor/TypoScript/Conditions', __DIR__ . '/../src/FileProcessor/TypoScript/Rector', __DIR__ . '/../src/FileProcessor/TypoScript/PostRector', __DIR__ . '/../src/FileProcessor/Yaml/Form/Rector', __DIR__ . '/../src/FileProcessor/Composer/Rector', __DIR__ . '/../src/FileProcessor/FlexForms/Rector', __DIR__ . '/../src/FileProcessor/Resources/Icons/Rector', __DIR__ . '/../src/FileProcessor/Fluid/Rector']);
$services->load('Ssch\\TYPO3Rector\\', __DIR__ . '/../src')->exclude([__DIR__ . '/../src/Rector', __DIR__ . '/../src/Set', __DIR__ . '/../src/ValueObject', __DIR__ . '/../src/FileProcessor/TypoScript/Conditions', __DIR__ . '/../src/FileProcessor/TypoScript/Rector', __DIR__ . '/../src/FileProcessor/TypoScript/PostRector', __DIR__ . '/../src/FileProcessor/Yaml/Form/Rector', __DIR__ . '/../src/FileProcessor/Composer/Rector', __DIR__ . '/../src/FileProcessor/FlexForms/Rector', __DIR__ . '/../src/FileProcessor/Resources/Icons/Rector', __DIR__ . '/../src/FileProcessor/Resources/Files/Rector', __DIR__ . '/../src/FileProcessor/Fluid/Rector']);
$services->set(\Helmich\TypoScriptParser\Parser\Traverser\Traverser::class);
$services->set(\RectorPrefix20220523\Helmich\TypoScriptParser\Tokenizer\Tokenizer::class);
$services->alias(\RectorPrefix20220523\Helmich\TypoScriptParser\Tokenizer\TokenizerInterface::class, \RectorPrefix20220523\Helmich\TypoScriptParser\Tokenizer\Tokenizer::class);

View File

@ -4,6 +4,7 @@ declare (strict_types=1);
namespace RectorPrefix20220523;
use Rector\Config\RectorConfig;
use Ssch\TYPO3Rector\FileProcessor\Resources\Files\Rector\RenameExtTypoScriptFilesFileRector;
use Ssch\TYPO3Rector\Rector\Migrations\RenameClassMapAliasRector;
use Ssch\TYPO3Rector\Rector\v12\v0\MigrateColsToSizeForTcaTypeNoneRector;
use Ssch\TYPO3Rector\Rector\v12\v0\MigrateInternalTypeRector;
@ -13,4 +14,5 @@ return static function (\Rector\Config\RectorConfig $rectorConfig) : void {
$rectorConfig->rule(\Ssch\TYPO3Rector\Rector\v12\v0\MigrateInternalTypeRector::class);
$rectorConfig->ruleWithConfiguration(\Ssch\TYPO3Rector\Rector\Migrations\RenameClassMapAliasRector::class, [__DIR__ . '/../../Migrations/TYPO3/12.0/typo3/sysext/backend/Migrations/Code/ClassAliasMap.php', __DIR__ . '/../../Migrations/TYPO3/12.0/typo3/sysext/frontend/Migrations/Code/ClassAliasMap.php']);
$rectorConfig->rule(\Ssch\TYPO3Rector\Rector\v12\v0\ReplacePreviewUrlMethodRector::class);
$rectorConfig->rule(\Ssch\TYPO3Rector\FileProcessor\Resources\Files\Rector\RenameExtTypoScriptFilesFileRector::class);
};

View File

@ -1,4 +1,4 @@
# 239 Rules Overview
# 240 Rules Overview
## AddRenderTypeToSelectFieldRector
@ -3366,6 +3366,19 @@ return static function (RectorConfig $rectorConfig): void {
<br>
## RenameExtTypoScriptFilesFileRector
Rename ext_typoscript_*.txt to ext_typoscript_*.typoscript
- class: [`Ssch\TYPO3Rector\FileProcessor\Resources\Files\Rector\RenameExtTypoScriptFilesFileRector`](../src/FileProcessor/Resources/Files/Rector/RenameExtTypoScriptFilesFileRector.php)
```diff
-ext_typoscript_constants.txt
+ext_typoscript_constants.typoscript
```
<br>
## RenameMethodCallToEnvironmentMethodCallRector
Turns method call names to new ones from new Environment API.

View File

@ -53,6 +53,7 @@ It will create the skeleton for the rector with the class, test class, fixtures
- keep it flat! Use early returns (with null) in case your conditions for migration are not met
- the `getNodeTypes` method is used to define the use case of the function to migrate. It helps as well acting like an early return (see example below)
- helper functions and classes are provided via rector to make it easy for you to control further processing
- here is a list of all php node types: https://github.com/rectorphp/php-parser-nodes-docs/blob/master/README.md
### Example

View File

@ -0,0 +1,11 @@
<?php
declare (strict_types=1);
namespace Ssch\TYPO3Rector\Contract\FileProcessor\Resources;
use Rector\Core\Contract\Rector\RectorInterface;
use Rector\Core\ValueObject\Application\File;
interface FileRectorInterface extends \Rector\Core\Contract\Rector\RectorInterface
{
public function refactorFile(\Rector\Core\ValueObject\Application\File $file) : void;
}

View File

@ -0,0 +1,46 @@
<?php
declare (strict_types=1);
namespace Ssch\TYPO3Rector\FileProcessor\Resources\Files;
use Rector\Core\Contract\Processor\FileProcessorInterface;
use Rector\Core\ValueObject\Application\File;
use Rector\Core\ValueObject\Configuration;
use Rector\Core\ValueObject\Error\SystemError;
use Rector\Core\ValueObject\Reporting\FileDiff;
use Rector\Parallel\ValueObject\Bridge;
use Ssch\TYPO3Rector\Contract\FileProcessor\Resources\FileRectorInterface;
final class ExtTypoScriptFileProcessor implements \Rector\Core\Contract\Processor\FileProcessorInterface
{
/**
* @var FileRectorInterface[]
* @readonly
*/
private $filesRector;
/**
* @param FileRectorInterface[] $filesRector
*/
public function __construct(array $filesRector)
{
$this->filesRector = $filesRector;
}
public function supports(\Rector\Core\ValueObject\Application\File $file, \Rector\Core\ValueObject\Configuration $configuration) : bool
{
return \true;
}
/**
* @return array{system_errors: SystemError[], file_diffs: FileDiff[]}
*/
public function process(\Rector\Core\ValueObject\Application\File $file, \Rector\Core\ValueObject\Configuration $configuration) : array
{
foreach ($this->filesRector as $fileRector) {
$fileRector->refactorFile($file);
}
// to keep parent contract with return values
return [\Rector\Parallel\ValueObject\Bridge::SYSTEM_ERRORS => [], \Rector\Parallel\ValueObject\Bridge::FILE_DIFFS => []];
}
public function getSupportedFileExtensions() : array
{
return ['txt'];
}
}

View File

@ -0,0 +1,74 @@
<?php
declare (strict_types=1);
namespace Ssch\TYPO3Rector\FileProcessor\Resources\Files\Rector;
use Rector\Core\Application\FileSystem\RemovedAndAddedFilesCollector;
use Rector\Core\ValueObject\Application\File;
use Rector\Testing\PHPUnit\StaticPHPUnitEnvironment;
use Ssch\TYPO3Rector\Contract\FileProcessor\Resources\FileRectorInterface;
use Ssch\TYPO3Rector\Helper\FilesFinder;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use Symplify\SmartFileSystem\SmartFileInfo;
final class RenameExtTypoScriptFilesFileRector implements \Ssch\TYPO3Rector\Contract\FileProcessor\Resources\FileRectorInterface
{
/**
* @readonly
* @var \Rector\Core\Application\FileSystem\RemovedAndAddedFilesCollector
*/
private $removedAndAddedFilesCollector;
/**
* @readonly
* @var \Ssch\TYPO3Rector\Helper\FilesFinder
*/
private $filesFinder;
public function __construct(\Rector\Core\Application\FileSystem\RemovedAndAddedFilesCollector $removedAndAddedFilesCollector, \Ssch\TYPO3Rector\Helper\FilesFinder $filesFinder)
{
$this->removedAndAddedFilesCollector = $removedAndAddedFilesCollector;
$this->filesFinder = $filesFinder;
}
public function refactorFile(\Rector\Core\ValueObject\Application\File $file) : void
{
if ($this->shouldSkip($file)) {
return;
}
$smartFileInfo = $file->getSmartFileInfo();
$newFileName = $smartFileInfo->getPath() . $smartFileInfo->getBasenameWithoutSuffix() . '.typoscript';
$this->removedAndAddedFilesCollector->addMovedFile($file, $newFileName);
}
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
{
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Rename ext_typoscript_*.txt to ext_typoscript_*.typoscript', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
ext_typoscript_constants.txt
CODE_SAMPLE
, <<<'CODE_SAMPLE'
ext_typoscript_constants.typoscript
CODE_SAMPLE
)]);
}
private function shouldSkip(\Rector\Core\ValueObject\Application\File $file) : bool
{
$smartFileInfo = $file->getSmartFileInfo();
$extEmConfFile = $this->filesFinder->findExtEmConfRelativeFromGivenFileInfo($smartFileInfo);
if (!$extEmConfFile instanceof \Symplify\SmartFileSystem\SmartFileInfo) {
return \true;
}
if ($extEmConfFile->getPath() !== $smartFileInfo->getPath()) {
return \true;
}
if ('ext_typoscript_setup.txt' === $smartFileInfo->getBasename()) {
return \false;
}
if ('ext_typoscript_constants.txt' === $smartFileInfo->getBasename()) {
return \false;
}
if (\Rector\Testing\PHPUnit\StaticPHPUnitEnvironment::isPHPUnitRun() && \substr_compare($smartFileInfo->getBasename(), 'ext_typoscript_constants.txt', -\strlen('ext_typoscript_constants.txt')) === 0) {
return \false;
}
if (\Rector\Testing\PHPUnit\StaticPHPUnitEnvironment::isPHPUnitRun() && \substr_compare($smartFileInfo->getBasename(), 'ext_typoscript_setup.txt', -\strlen('ext_typoscript_setup.txt')) === 0) {
return \false;
}
return \true;
}
}