From 7313b643743e9b08bdd2522fbc9b7cf16ffafbcb Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 29 May 2021 22:10:59 +0000 Subject: [PATCH] Updated Rector to commit b90952fdeb81cce5dce10b34f97490701cc0537c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rectorphp/rector-src/commit/b90952fdeb81cce5dce10b34f97490701cc0537c Let Rector upgrade itself to PHP 8 🤖😇 (#123) --- config/set/downgrade-php80.php | 5 +++++ config/set/php80.php | 2 +- .../PhpDoc/DoctrineAnnotationTagValueNode.php | 1 + .../PhpDoc/SpacelessPhpDocTagNode.php | 1 + .../BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php | 2 +- .../PhpDocParser/ClassAnnotationMatcher.php | 2 +- .../PhpDocParser/DoctrineAnnotationDecorator.php | 7 +++---- .../Printer/PhpDocInfoPrinter.php | 2 +- .../PhpDoc/DoctrineAnnotation/CurlyListNode.php | 1 + .../PhpDoc/SpacingAwareTemplateTagValueNode.php | 1 + .../PhpDoc/VariadicAwareParamTagValueNode.php | 1 + .../PhpDocNode/AbstractTagValueNode.php | 1 + .../Type/BracketsAwareIntersectionTypeNode.php | 1 + .../Type/BracketsAwareUnionTypeNode.php | 1 + .../ValueObject/Type/EmptyGenericTypeNode.php | 1 + .../Type/FullyQualifiedIdentifierTypeNode.php | 1 + .../ValueObject/Type/SpacingAwareArrayTypeNode.php | 1 + .../Type/SpacingAwareCallableTypeNode.php | 4 ++-- .../FileFormatter/Formatter/XmlFileFormatter.php | 6 +++--- packages/FileFormatter/ValueObject/Indent.php | 3 ++- packages/FileFormatter/ValueObject/NewLine.php | 2 +- .../AddedFileWithNodesFactory.php | 2 +- .../NodeCollector/NodeCollector/NodeRepository.php | 5 ++--- .../NodeCollector/ParsedNodeCollector.php | 5 ++--- packages/NodeNameResolver/NodeNameResolver.php | 2 +- .../PHPStan/Scope/PHPStanNodeScopeResolver.php | 2 +- .../UnderscoreRenamePhpDocNodeVisitor.php | 2 +- .../TypeMapper/ObjectTypeMapper.php | 3 +-- packages/PostRector/Rector/UseAddingPostRector.php | 3 +-- .../PhpParser/FullyQualifiedNodeMapper.php | 3 +-- .../ValueObject/Type/FullyQualifiedObjectType.php | 2 +- rules/Arguments/ArgumentDefaultValueReplacer.php | 3 +-- ...oveValueObjectsToValueObjectDirectoryRector.php | 5 ++--- .../Catch_/ThrowWithPreviousExceptionRector.php | 3 +-- .../Rector/If_/SimplifyIfReturnBoolRector.php | 3 +-- .../AbsolutizeRequireAndIncludePathRector.php | 6 +++--- rules/CodingStyle/Application/UseImportsAdder.php | 2 +- .../AliasClassNameImportSkipVoter.php | 3 +-- .../ClassNameImport/ClassNameImportSkipper.php | 3 +-- .../ClassNameImport/ShortNameResolver.php | 4 ++-- rules/CodingStyle/Naming/ClassNaming.php | 2 +- rules/CodingStyle/Node/NameImporter.php | 3 +-- .../ManualJsonStringToJsonEncodeArrayRector.php | 2 +- .../Rector/Assign/PHPStormVarAnnotationRector.php | 4 ++-- .../Encapsed/EncapsedStringsToSprintfRector.php | 3 +-- .../FuncCall/PreslashSimpleFunctionRector.php | 3 +-- .../Rector/Include_/FollowRequireByDirRector.php | 6 +++--- .../ReplaceVariableByPropertyFetchRector.php | 3 +-- .../DowngradeGeneratedScalarTypesRector.php | 2 +- .../DowngradeNumericLiteralSeparatorRector.php | 5 ++--- .../DowngradeAttributeToAnnotationRector.php | 3 +-- .../Foreach_/ReturnAfterToEarlyOnBreakRector.php | 4 ++-- rules/Naming/Guard/BreakingVariableRenameGuard.php | 6 ++++-- rules/Naming/Naming/PropertyNaming.php | 14 +++++++------- rules/Naming/ParamRenamer/ParamRenamer.php | 2 +- ...meVariableToMatchMethodCallReturnTypeRector.php | 2 +- .../RenameVariableToMatchNewTypeRector.php | 2 +- ...ueVariableToMatchMethodCallReturnTypeRector.php | 2 +- rules/Naming/VariableRenamer.php | 2 +- .../StaticCall/AddRemovedDefaultValuesRector.php | 3 +-- rules/PSR4/Composer/PSR4NamespaceMatcher.php | 2 +- rules/PSR4/FileRelocationResolver.php | 2 +- rules/Php55/RegexMatcher.php | 4 ++-- rules/Php70/EregToPcreTransformer.php | 8 ++++---- rules/Php70/NodeAnalyzer/VariableNaming.php | 2 +- .../Rector/FuncCall/EregToPregMatchRector.php | 7 +++---- .../Rector/String_/SensitiveHereNowDocRector.php | 5 ++--- .../LNumber/AddLiteralSeparatorToNumberRector.php | 4 ++-- ...sPropertyAssignToConstructorPromotionRector.php | 2 +- rules/PhpSpecToPHPUnit/Naming/PhpSpecRenaming.php | 3 +-- .../PhpSpecMethodToPHPUnitMethodRector.php | 3 +-- .../RemovingStatic/UniqueObjectFactoryFactory.php | 2 +- .../Rector/FuncCall/RenameFunctionRector.php | 3 +-- .../PHPStan/Type/ObjectTypeSpecifier.php | 2 +- .../NonInformativeReturnTagRemover.php | 5 ++--- .../ConstructorPropertyTypeInferer.php | 3 +-- .../DoctrineRelationPropertyTypeInferer.php | 2 +- src/Application/VersionResolver.php | 4 ++-- src/Configuration/Configuration.php | 3 +-- src/Console/Command/ProcessCommand.php | 3 +-- .../VerifyRectorServiceExistsCompilerPass.php | 3 +-- src/FileSystem/FilesystemTweaker.php | 5 ++--- src/FileSystem/PhpFilesFinder.php | 3 +-- src/NodeManipulator/VariableManipulator.php | 3 +-- src/NonPhpFile/NonPhpFileProcessor.php | 3 +-- src/NonPhpFile/Rector/RenameClassNonPhpRector.php | 4 ++-- src/PhpParser/Node/Value/ValueResolver.php | 2 +- src/Reflection/MethodReflectionToAstResolver.php | 3 +-- src/Template/DefaultResolver.php | 1 + src/Util/StaticRectorStrings.php | 7 ++----- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +++++++------- vendor/composer/autoload_static.php | 8 ++++---- vendor/scoper-autoload.php | 10 +++++----- vendor/symfony/string/AbstractString.php | 2 +- vendor/symfony/string/LazyString.php | 2 +- 96 files changed, 152 insertions(+), 169 deletions(-) diff --git a/config/set/downgrade-php80.php b/config/set/downgrade-php80.php index 44f8f5715a1a..49fcea12f373 100644 --- a/config/set/downgrade-php80.php +++ b/config/set/downgrade-php80.php @@ -16,11 +16,16 @@ use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeUnionTypeDeclarationRector; use Rector\DowngradePhp80\Rector\NullsafeMethodCall\DowngradeNullsafeToTernaryOperatorRector; use Rector\DowngradePhp80\Rector\Property\DowngradeUnionTypeTypedPropertyRector; +use Rector\Removing\Rector\Class_\RemoveInterfacesRector; use RectorPrefix20210529\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return static function (\RectorPrefix20210529\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { $parameters = $containerConfigurator->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_74); $services = $containerConfigurator->services(); + $services->set(\Rector\Removing\Rector\Class_\RemoveInterfacesRector::class)->call('configure', [[\Rector\Removing\Rector\Class_\RemoveInterfacesRector::INTERFACES_TO_REMOVE => [ + // @see https://wiki.php.net/rfc/stringable + 'Stringable', + ]]]); $services->set(\Rector\DowngradePhp80\Rector\Property\DowngradeUnionTypeTypedPropertyRector::class); $services->set(\Rector\DowngradePhp80\Rector\FunctionLike\DowngradeUnionTypeDeclarationRector::class); $services->set(\Rector\DowngradePhp80\Rector\FunctionLike\DowngradeMixedTypeDeclarationRector::class); diff --git a/config/set/php80.php b/config/set/php80.php index ba6375ecca10..1da222ab3f16 100644 --- a/config/set/php80.php +++ b/config/set/php80.php @@ -33,7 +33,7 @@ $services->set(\Rector\Php80\Rector\NotIdentical\StrContainsRector::class); $services->set(\Rector\Php80\Rector\Identical\StrStartsWithRector::class); $services->set(\Rector\Php80\Rector\Identical\StrEndsWithRector::class); - $services->set(\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::class)->call('configure', [\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::STATIC_CALLS_TO_FUNCTIONS => \Symplify\SymfonyPhpConfig\ValueObjectInliner::inline([new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'startsWith', 'str_starts_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'endsWith', 'str_ends_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'contains', 'str_contains')])]); + $services->set(\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::class)->call('configure', [[\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::STATIC_CALLS_TO_FUNCTIONS => \Symplify\SymfonyPhpConfig\ValueObjectInliner::inline([new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'startsWith', 'str_starts_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'endsWith', 'str_ends_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'contains', 'str_contains')])]]); $services->set(\Rector\Php80\Rector\Class_\StringableForToStringRector::class); $services->set(\Rector\Php80\Rector\FuncCall\ClassOnObjectRector::class); $services->set(\Rector\Php80\Rector\Ternary\GetDebugTypeRector::class); diff --git a/packages/BetterPhpDocParser/PhpDoc/DoctrineAnnotationTagValueNode.php b/packages/BetterPhpDocParser/PhpDoc/DoctrineAnnotationTagValueNode.php index f5862657408b..5471dc66355a 100644 --- a/packages/BetterPhpDocParser/PhpDoc/DoctrineAnnotationTagValueNode.php +++ b/packages/BetterPhpDocParser/PhpDoc/DoctrineAnnotationTagValueNode.php @@ -4,6 +4,7 @@ namespace Rector\BetterPhpDocParser\PhpDoc; use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\AbstractValuesAwareNode; +use Stringable; final class DoctrineAnnotationTagValueNode extends \Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\AbstractValuesAwareNode { /** diff --git a/packages/BetterPhpDocParser/PhpDoc/SpacelessPhpDocTagNode.php b/packages/BetterPhpDocParser/PhpDoc/SpacelessPhpDocTagNode.php index 0c4e5dc97bb0..3464b0c34faa 100644 --- a/packages/BetterPhpDocParser/PhpDoc/SpacelessPhpDocTagNode.php +++ b/packages/BetterPhpDocParser/PhpDoc/SpacelessPhpDocTagNode.php @@ -4,6 +4,7 @@ namespace Rector\BetterPhpDocParser\PhpDoc; use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; +use Stringable; /** * Useful for annotation class based annotation, e.g. @ORM\Entity to prevent space * between the @ORM\Entity and (someContent) diff --git a/packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php b/packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php index 447e3e54e829..dfb24671f821 100644 --- a/packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php +++ b/packages/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php @@ -448,7 +448,7 @@ private function resolveNameForPhpDocTagValueNode(\PHPStan\PhpDocParser\Ast\PhpD } private function isFnmatch(string $currentValue, string $desiredValue) : bool { - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($desiredValue, '*')) { + if (\strpos($desiredValue, '*') === \false) { return \false; } return \fnmatch($desiredValue, $currentValue, \FNM_NOESCAPE); diff --git a/packages/BetterPhpDocParser/PhpDocParser/ClassAnnotationMatcher.php b/packages/BetterPhpDocParser/PhpDocParser/ClassAnnotationMatcher.php index 85755b6b062c..d83c7d5cb7d2 100644 --- a/packages/BetterPhpDocParser/PhpDocParser/ClassAnnotationMatcher.php +++ b/packages/BetterPhpDocParser/PhpDocParser/ClassAnnotationMatcher.php @@ -84,7 +84,7 @@ private function resolveName(string $tag, \PhpParser\Node\Stmt\UseUse $useUse) : return $useUse->name->toString(); } $unaliasedShortClass = \RectorPrefix20210529\Nette\Utils\Strings::substring($tag, \RectorPrefix20210529\Nette\Utils\Strings::length($useUse->alias->toString())); - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($unaliasedShortClass, '\\')) { + if (\str_starts_with($unaliasedShortClass, '\\')) { return $useUse->name . $unaliasedShortClass; } return $useUse->name . '\\' . $unaliasedShortClass; diff --git a/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php b/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php index 4045bf23a272..f07b95166b67 100644 --- a/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php +++ b/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\BetterPhpDocParser\PhpDocParser; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode; @@ -129,7 +128,7 @@ private function transformGenericTagValueNodesToDoctrineAnnotationTagValueNodes( // known doc tag to annotation class $fullyQualifiedAnnotationClass = $this->classAnnotationMatcher->resolveTagFullyQualifiedName($phpDocChildNode->name, $currentPhpNode); // not an annotations class - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($fullyQualifiedAnnotationClass, '\\')) { + if (\strpos($fullyQualifiedAnnotationClass, '\\') === \false) { continue; } $genericTagValueNode = $phpDocChildNode->value; @@ -159,10 +158,10 @@ private function isClosedContent(string $composedContent) : bool return \true; } do { - if ($composedTokenIterator->isCurrentTokenTypes([\PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_OPEN_CURLY_BRACKET, \PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_OPEN_PARENTHESES]) || \RectorPrefix20210529\Nette\Utils\Strings::contains($composedTokenIterator->currentTokenValue(), '(')) { + if ($composedTokenIterator->isCurrentTokenTypes([\PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_OPEN_CURLY_BRACKET, \PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_OPEN_PARENTHESES]) || \strpos($composedTokenIterator->currentTokenValue(), '(') !== \false) { ++$openBracketCount; } - if ($composedTokenIterator->isCurrentTokenTypes([\PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_CLOSE_CURLY_BRACKET, \PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_CLOSE_PARENTHESES]) || \RectorPrefix20210529\Nette\Utils\Strings::contains($composedTokenIterator->currentTokenValue(), ')')) { + if ($composedTokenIterator->isCurrentTokenTypes([\PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_CLOSE_CURLY_BRACKET, \PHPStan\PhpDocParser\Lexer\Lexer::TOKEN_CLOSE_PARENTHESES]) || \strpos($composedTokenIterator->currentTokenValue(), ')') !== \false) { ++$closeBracketCount; } $composedTokenIterator->next(); diff --git a/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php b/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php index d61edfe5c61d..9816f4b55f66 100644 --- a/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php +++ b/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php @@ -230,7 +230,7 @@ private function addTokensFromTo(string $output, int $from, int $to, bool $shoul --$from; } // skip extra empty lines above if this is the last one - if ($shouldSkipEmptyLinesAbove && \RectorPrefix20210529\Nette\Utils\Strings::contains($this->tokens[$from][0], \PHP_EOL) && \RectorPrefix20210529\Nette\Utils\Strings::contains($this->tokens[$from + 1][0], \PHP_EOL)) { + if ($shouldSkipEmptyLinesAbove && \strpos($this->tokens[$from][0], \PHP_EOL) !== \false && \strpos($this->tokens[$from + 1][0], \PHP_EOL) !== \false) { ++$from; } return $this->appendToOutput($output, $from, $to, $positionJumpSet); diff --git a/packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/CurlyListNode.php b/packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/CurlyListNode.php index f5f1df174bf8..25be9f0e64c9 100644 --- a/packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/CurlyListNode.php +++ b/packages/BetterPhpDocParser/ValueObject/PhpDoc/DoctrineAnnotation/CurlyListNode.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation; +use Stringable; final class CurlyListNode extends \Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\AbstractValuesAwareNode { public function __toString() : string diff --git a/packages/BetterPhpDocParser/ValueObject/PhpDoc/SpacingAwareTemplateTagValueNode.php b/packages/BetterPhpDocParser/ValueObject/PhpDoc/SpacingAwareTemplateTagValueNode.php index 8b78e9f19747..006b6f805142 100644 --- a/packages/BetterPhpDocParser/ValueObject/PhpDoc/SpacingAwareTemplateTagValueNode.php +++ b/packages/BetterPhpDocParser/ValueObject/PhpDoc/SpacingAwareTemplateTagValueNode.php @@ -5,6 +5,7 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; +use Stringable; final class SpacingAwareTemplateTagValueNode extends \PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode { /** diff --git a/packages/BetterPhpDocParser/ValueObject/PhpDoc/VariadicAwareParamTagValueNode.php b/packages/BetterPhpDocParser/ValueObject/PhpDoc/VariadicAwareParamTagValueNode.php index e337ecc0453d..4260e70d703c 100644 --- a/packages/BetterPhpDocParser/ValueObject/PhpDoc/VariadicAwareParamTagValueNode.php +++ b/packages/BetterPhpDocParser/ValueObject/PhpDoc/VariadicAwareParamTagValueNode.php @@ -4,6 +4,7 @@ namespace Rector\BetterPhpDocParser\ValueObject\PhpDoc; use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; +use Stringable; final class VariadicAwareParamTagValueNode extends \PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode { public function __toString() : string diff --git a/packages/BetterPhpDocParser/ValueObject/PhpDocNode/AbstractTagValueNode.php b/packages/BetterPhpDocParser/ValueObject/PhpDocNode/AbstractTagValueNode.php index 8fc708170336..38cf6f7e225a 100644 --- a/packages/BetterPhpDocParser/ValueObject/PhpDocNode/AbstractTagValueNode.php +++ b/packages/BetterPhpDocParser/ValueObject/PhpDocNode/AbstractTagValueNode.php @@ -6,6 +6,7 @@ use PHPStan\PhpDocParser\Ast\Node; use PHPStan\PhpDocParser\Ast\NodeAttributes; use Rector\Core\Exception\ShouldNotHappenException; +use Stringable; /** * @deprecated * Just for back compatibility diff --git a/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareIntersectionTypeNode.php b/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareIntersectionTypeNode.php index b1f8e8691037..97d9fa5bddb8 100644 --- a/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareIntersectionTypeNode.php +++ b/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareIntersectionTypeNode.php @@ -4,6 +4,7 @@ namespace Rector\BetterPhpDocParser\ValueObject\Type; use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode; +use Stringable; final class BracketsAwareIntersectionTypeNode extends \PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode { public function __toString() : string diff --git a/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareUnionTypeNode.php b/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareUnionTypeNode.php index 3d3f636ca3eb..4b55df168571 100644 --- a/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareUnionTypeNode.php +++ b/packages/BetterPhpDocParser/ValueObject/Type/BracketsAwareUnionTypeNode.php @@ -5,6 +5,7 @@ use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; +use Stringable; final class BracketsAwareUnionTypeNode extends \PHPStan\PhpDocParser\Ast\Type\UnionTypeNode { /** diff --git a/packages/BetterPhpDocParser/ValueObject/Type/EmptyGenericTypeNode.php b/packages/BetterPhpDocParser/ValueObject/Type/EmptyGenericTypeNode.php index e5675d88b782..2f458d54928d 100644 --- a/packages/BetterPhpDocParser/ValueObject/Type/EmptyGenericTypeNode.php +++ b/packages/BetterPhpDocParser/ValueObject/Type/EmptyGenericTypeNode.php @@ -5,6 +5,7 @@ use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; +use Stringable; final class EmptyGenericTypeNode extends \PHPStan\PhpDocParser\Ast\Type\GenericTypeNode { public function __construct(\PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode $identifierTypeNode) diff --git a/packages/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php b/packages/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php index b1a909c63bb1..51a932ecf765 100644 --- a/packages/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php +++ b/packages/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php @@ -4,6 +4,7 @@ namespace Rector\BetterPhpDocParser\ValueObject\Type; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; +use Stringable; final class FullyQualifiedIdentifierTypeNode extends \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode { public function __toString() : string diff --git a/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareArrayTypeNode.php b/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareArrayTypeNode.php index 6b3c54ece3fc..f49a01a500b0 100644 --- a/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareArrayTypeNode.php +++ b/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareArrayTypeNode.php @@ -8,6 +8,7 @@ use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode; use Rector\PHPStanStaticTypeMapper\TypeMapper\ArrayTypeMapper; +use Stringable; final class SpacingAwareArrayTypeNode extends \PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode { public function __toString() : string diff --git a/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareCallableTypeNode.php b/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareCallableTypeNode.php index 9fb735b50d35..a789608633b9 100644 --- a/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareCallableTypeNode.php +++ b/packages/BetterPhpDocParser/ValueObject/Type/SpacingAwareCallableTypeNode.php @@ -3,11 +3,11 @@ declare (strict_types=1); namespace Rector\BetterPhpDocParser\ValueObject\Type; -use RectorPrefix20210529\Nette\Utils\Strings; use PHPStan\PhpDocParser\Ast\NodeAttributes; use PHPStan\PhpDocParser\Ast\Type\CallableTypeNode; use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; +use Stringable; final class SpacingAwareCallableTypeNode extends \PHPStan\PhpDocParser\Ast\Type\CallableTypeNode { use NodeAttributes; @@ -22,7 +22,7 @@ private function createExplicitCallable() : string $returnType = $this->returnType; $parameterTypeString = $this->createParameterTypeString(); $returnTypeAsString = (string) $returnType; - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($returnTypeAsString, '|')) { + if (\strpos($returnTypeAsString, '|') !== \false) { $returnTypeAsString = '(' . $returnTypeAsString . ')'; } $parameterTypeString = $this->normalizeParameterType($parameterTypeString, $returnTypeAsString); diff --git a/packages/FileFormatter/Formatter/XmlFileFormatter.php b/packages/FileFormatter/Formatter/XmlFileFormatter.php index e31a12018ecd..c48a1929c171 100644 --- a/packages/FileFormatter/Formatter/XmlFileFormatter.php +++ b/packages/FileFormatter/Formatter/XmlFileFormatter.php @@ -69,7 +69,7 @@ private function formatXml(string $xml) : string $output = ''; $this->depth = 0; $parts = $this->getXmlParts($xml); - if (\strpos($parts[0], ''); + return \strpos($part, ']]>') !== \false; } } diff --git a/packages/FileFormatter/ValueObject/Indent.php b/packages/FileFormatter/ValueObject/Indent.php index 1fc4283a3175..4f6ef0f92478 100644 --- a/packages/FileFormatter/ValueObject/Indent.php +++ b/packages/FileFormatter/ValueObject/Indent.php @@ -8,6 +8,7 @@ use Rector\FileFormatter\Exception\InvalidIndentStringException; use Rector\FileFormatter\Exception\InvalidIndentStyleException; use Rector\FileFormatter\Exception\ParseIndentException; +use Stringable; /** * @see \Rector\Tests\FileFormatter\ValueObject\IndentTest */ @@ -115,6 +116,6 @@ public function getIndentStyleCharacter() : string } private function startsWithSpace() : bool { - return \RectorPrefix20210529\Nette\Utils\Strings::startsWith($this->string, ' '); + return \str_starts_with($this->string, ' '); } } diff --git a/packages/FileFormatter/ValueObject/NewLine.php b/packages/FileFormatter/ValueObject/NewLine.php index 726953b54800..13f4a58290e6 100644 --- a/packages/FileFormatter/ValueObject/NewLine.php +++ b/packages/FileFormatter/ValueObject/NewLine.php @@ -10,7 +10,7 @@ /** * @see \Rector\Tests\FileFormatter\ValueObject\NewLineTest */ -final class NewLine implements \Stringable +final class NewLine { /** * @var string diff --git a/packages/FileSystemRector/ValueObjectFactory/AddedFileWithNodesFactory.php b/packages/FileSystemRector/ValueObjectFactory/AddedFileWithNodesFactory.php index 93470cba439c..462bfac0afc6 100644 --- a/packages/FileSystemRector/ValueObjectFactory/AddedFileWithNodesFactory.php +++ b/packages/FileSystemRector/ValueObjectFactory/AddedFileWithNodesFactory.php @@ -60,7 +60,7 @@ public function createWithDesiredGroup(\Symplify\SmartFileSystem\SmartFileInfo $ } // is already in the right group $currentNamespaceName = $currentNamespace->name->toString(); - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($currentNamespaceName, '\\' . $desiredGroupName)) { + if (\str_ends_with($currentNamespaceName, '\\' . $desiredGroupName)) { return null; } $oldClassName = $currentNamespaceName . '\\' . $this->fileInfoDeletionAnalyzer->clearNameFromTestingPrefix($oldFileInfo->getBasenameWithoutSuffix()); diff --git a/packages/NodeCollector/NodeCollector/NodeRepository.php b/packages/NodeCollector/NodeCollector/NodeRepository.php index 3652a790044b..e03060627fcb 100644 --- a/packages/NodeCollector/NodeCollector/NodeRepository.php +++ b/packages/NodeCollector/NodeCollector/NodeRepository.php @@ -4,7 +4,6 @@ namespace Rector\NodeCollector\NodeCollector; use RectorPrefix20210529\Nette\Utils\Arrays; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Attribute; use PhpParser\Node\Expr; @@ -168,7 +167,7 @@ public function findClassMethodByStaticCall(\PhpParser\Node\Expr\StaticCall $sta } public function findClassMethod(string $className, string $methodName) : ?\PhpParser\Node\Stmt\ClassMethod { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($methodName, '\\')) { + if (\strpos($methodName, '\\') !== \false) { $message = \sprintf('Class and method arguments are switched in "%s"', __METHOD__); throw new \Rector\Core\Exception\ShouldNotHappenException($message); } @@ -270,7 +269,7 @@ public function findClassesBySuffix(string $suffix) : array { $classNodes = []; foreach ($this->parsedNodeCollector->getClasses() as $className => $classNode) { - if (!\RectorPrefix20210529\Nette\Utils\Strings::endsWith($className, $suffix)) { + if (!\str_ends_with($className, $suffix)) { continue; } $classNodes[] = $classNode; diff --git a/packages/NodeCollector/NodeCollector/ParsedNodeCollector.php b/packages/NodeCollector/NodeCollector/ParsedNodeCollector.php index 898b106415f2..b55a8d5d03a9 100644 --- a/packages/NodeCollector/NodeCollector/ParsedNodeCollector.php +++ b/packages/NodeCollector/NodeCollector/ParsedNodeCollector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\NodeCollector\NodeCollector; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Expr\Array_; use PhpParser\Node\Expr\ClassConstFetch; @@ -115,7 +114,7 @@ public function findTrait(string $name) : ?\PhpParser\Node\Stmt\Trait_ public function findByShortName(string $shortName) : ?\PhpParser\Node\Stmt\Class_ { foreach ($this->classes as $className => $classNode) { - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($className, '\\' . $shortName)) { + if (\str_ends_with($className, '\\' . $shortName)) { return $classNode; } } @@ -123,7 +122,7 @@ public function findByShortName(string $shortName) : ?\PhpParser\Node\Stmt\Class } public function findClassConstant(string $className, string $constantName) : ?\PhpParser\Node\Stmt\ClassConst { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($constantName, '\\')) { + if (\strpos($constantName, '\\') !== \false) { throw new \Rector\Core\Exception\ShouldNotHappenException(\sprintf('Switched arguments in "%s"', __METHOD__)); } return $this->constantsByType[$className][$constantName] ?? null; diff --git a/packages/NodeNameResolver/NodeNameResolver.php b/packages/NodeNameResolver/NodeNameResolver.php index 858ff33b3ee6..e54cdd9a23cf 100644 --- a/packages/NodeNameResolver/NodeNameResolver.php +++ b/packages/NodeNameResolver/NodeNameResolver.php @@ -192,7 +192,7 @@ private function isSingleName(\PhpParser\Node $node, string $name) : bool return (bool) \RectorPrefix20210529\Nette\Utils\Strings::match($resolvedName, $name); } // is probably fnmatch - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($name, '*')) { + if (\strpos($name, '*') !== \false) { return \fnmatch($name, $resolvedName, \FNM_NOESCAPE); } // special case diff --git a/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php b/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php index 8977ae74f30e..07730e7100d1 100644 --- a/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php +++ b/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php @@ -167,7 +167,7 @@ private function resolveDependentFiles(\PhpParser\Node $node, \PHPStan\Analyser\ foreach ($dependentFiles as $dependentFile) { $this->dependentFiles[] = $dependentFile; } - } catch (\PHPStan\AnalysedCodeException $analysedCodeException) { + } catch (\PHPStan\AnalysedCodeException $exception) { // @ignoreException } } diff --git a/packages/NodeTypeResolver/PhpDocNodeVisitor/UnderscoreRenamePhpDocNodeVisitor.php b/packages/NodeTypeResolver/PhpDocNodeVisitor/UnderscoreRenamePhpDocNodeVisitor.php index 5da1617c7bc2..991be74b05c4 100644 --- a/packages/NodeTypeResolver/PhpDocNodeVisitor/UnderscoreRenamePhpDocNodeVisitor.php +++ b/packages/NodeTypeResolver/PhpDocNodeVisitor/UnderscoreRenamePhpDocNodeVisitor.php @@ -69,7 +69,7 @@ private function shouldSkip(\PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode $i if (!$staticType instanceof \PHPStan\Type\ObjectType) { return \true; } - if (!\RectorPrefix20210529\Nette\Utils\Strings::startsWith($staticType->getClassName(), $pseudoNamespaceToNamespace->getNamespacePrefix())) { + if (!\str_starts_with($staticType->getClassName(), $pseudoNamespaceToNamespace->getNamespacePrefix())) { return \true; } // excluded? diff --git a/packages/PHPStanStaticTypeMapper/TypeMapper/ObjectTypeMapper.php b/packages/PHPStanStaticTypeMapper/TypeMapper/ObjectTypeMapper.php index a11d47352c77..05f3b15fd861 100644 --- a/packages/PHPStanStaticTypeMapper/TypeMapper/ObjectTypeMapper.php +++ b/packages/PHPStanStaticTypeMapper/TypeMapper/ObjectTypeMapper.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\PHPStanStaticTypeMapper\TypeMapper; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Name; use PhpParser\Node\Name\FullyQualified; @@ -112,7 +111,7 @@ private function resolveGenericObjectTypeName(\PHPStan\Type\Generic\GenericObjec if ($genericObjectType instanceof \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedGenericObjectType) { return '\\' . $genericObjectType->getClassName(); } - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($genericObjectType->getClassName(), '\\')) { + if (\strpos($genericObjectType->getClassName(), '\\') !== \false) { return '\\' . $genericObjectType->getClassName(); } return $genericObjectType->getClassName(); diff --git a/packages/PostRector/Rector/UseAddingPostRector.php b/packages/PostRector/Rector/UseAddingPostRector.php index a8dbed1fb222..ad41b0b030b8 100644 --- a/packages/PostRector/Rector/UseAddingPostRector.php +++ b/packages/PostRector/Rector/UseAddingPostRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\PostRector\Rector; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Namespace_; use Rector\CodingStyle\Application\UseImportsAdder; @@ -129,7 +128,7 @@ private function filterOutNonNamespacedNames(array $useImportTypes) : array { $namespacedUseImportTypes = []; foreach ($useImportTypes as $useImportType) { - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($useImportType->getClassName(), '\\')) { + if (\strpos($useImportType->getClassName(), '\\') === \false) { continue; } $namespacedUseImportTypes[] = $useImportType; diff --git a/packages/StaticTypeMapper/PhpParser/FullyQualifiedNodeMapper.php b/packages/StaticTypeMapper/PhpParser/FullyQualifiedNodeMapper.php index 2141da9c1a2b..a0e7d70e6a7f 100644 --- a/packages/StaticTypeMapper/PhpParser/FullyQualifiedNodeMapper.php +++ b/packages/StaticTypeMapper/PhpParser/FullyQualifiedNodeMapper.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\StaticTypeMapper\PhpParser; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Name\FullyQualified; use PHPStan\Type\Type; @@ -41,6 +40,6 @@ private function isAliasedName(string $originalName, string $fullyQualifiedName) if ($originalName === $fullyQualifiedName) { return \false; } - return !\RectorPrefix20210529\Nette\Utils\Strings::endsWith($fullyQualifiedName, '\\' . $originalName); + return !\str_ends_with($fullyQualifiedName, '\\' . $originalName); } } diff --git a/packages/StaticTypeMapper/ValueObject/Type/FullyQualifiedObjectType.php b/packages/StaticTypeMapper/ValueObject/Type/FullyQualifiedObjectType.php index aaf49c7b24f0..95f2a5118f21 100644 --- a/packages/StaticTypeMapper/ValueObject/Type/FullyQualifiedObjectType.php +++ b/packages/StaticTypeMapper/ValueObject/Type/FullyQualifiedObjectType.php @@ -24,7 +24,7 @@ public function areShortNamesEqual(\PHPStan\Type\ObjectType $comparedObjectType) } public function getShortName() : string { - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($this->getClassName(), '\\')) { + if (\strpos($this->getClassName(), '\\') === \false) { return $this->getClassName(); } return (string) \RectorPrefix20210529\Nette\Utils\Strings::after($this->getClassName(), '\\', -1); diff --git a/rules/Arguments/ArgumentDefaultValueReplacer.php b/rules/Arguments/ArgumentDefaultValueReplacer.php index 48df357b944b..7c10e1124705 100644 --- a/rules/Arguments/ArgumentDefaultValueReplacer.php +++ b/rules/Arguments/ArgumentDefaultValueReplacer.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Arguments; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\BuilderHelpers; use PhpParser\Node; use PhpParser\Node\Arg; @@ -66,7 +65,7 @@ private function processArgs(\PhpParser\Node\Expr $expr, \Rector\Arguments\Contr private function normalizeValueToArgument($value) : \PhpParser\Node\Arg { // class constants → turn string to composite - if (\is_string($value) && \RectorPrefix20210529\Nette\Utils\Strings::contains($value, '::')) { + if (\is_string($value) && \strpos($value, '::') !== \false) { [$class, $constant] = \explode('::', $value); $classConstFetch = $this->nodeFactory->createClassConstFetch($class, $constant); return new \PhpParser\Node\Arg($classConstFetch); diff --git a/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php b/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php index ae2052934cb2..1be15924e72c 100644 --- a/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php +++ b/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php @@ -4,7 +4,6 @@ namespace Rector\Autodiscovery\Rector\Class_; use RectorPrefix20210529\Controller; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Stmt\Class_; use PHPStan\Type\ObjectType; @@ -168,7 +167,7 @@ private function isSuffixMatch(\PhpParser\Node\Stmt\Class_ $class) : bool return \false; } foreach ($this->suffixes as $suffix) { - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($className, $suffix)) { + if (\str_ends_with($className, $suffix)) { return \true; } } @@ -177,7 +176,7 @@ private function isSuffixMatch(\PhpParser\Node\Stmt\Class_ $class) : bool private function isKnownServiceType(string $className) : bool { foreach (self::COMMON_SERVICE_SUFFIXES as $commonServiceSuffix) { - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($className, $commonServiceSuffix)) { + if (\str_ends_with($className, $commonServiceSuffix)) { return \true; } } diff --git a/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php b/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php index a37c3468c174..32765584ff31 100644 --- a/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php +++ b/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\CodeQuality\Rector\Catch_; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr\MethodCall; @@ -135,7 +134,7 @@ private function resolveExceptionArgumentPosition(\PhpParser\Node\Name $exceptio { $className = $this->getName($exceptionName); // is native exception? - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($className, '\\')) { + if (\strpos($className, '\\') === \false) { return self::DEFAULT_EXCEPTION_ARGUMENT_POSITION; } if (!$this->reflectionProvider->hasClass($className)) { diff --git a/rules/CodeQuality/Rector/If_/SimplifyIfReturnBoolRector.php b/rules/CodeQuality/Rector/If_/SimplifyIfReturnBoolRector.php index 03283f952226..2085ac2889a6 100644 --- a/rules/CodeQuality/Rector/If_/SimplifyIfReturnBoolRector.php +++ b/rules/CodeQuality/Rector/If_/SimplifyIfReturnBoolRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\CodeQuality\Rector\If_; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Expr\BinaryOp\Identical; @@ -110,7 +109,7 @@ private function shouldSkip(\PhpParser\Node\Stmt\If_ $if) : bool if (!$this->valueResolver->isFalse($returnedExpr)) { return !$this->valueResolver->isTrueOrFalse($nextNode->expr); } - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($this->print($if->cond), '!=')) { + if (\strpos($this->print($if->cond), '!=') === \false) { return !$this->valueResolver->isTrueOrFalse($nextNode->expr); } return \true; diff --git a/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php b/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php index c0cda67ba80e..952b1dfc784a 100644 --- a/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php +++ b/rules/CodeQuality/Rector/Include_/AbsolutizeRequireAndIncludePathRector.php @@ -63,15 +63,15 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node /** @var string $includeValue */ $includeValue = $this->valueResolver->getValue($node->expr); // skip phar - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($includeValue, 'phar://')) { + if (\str_starts_with($includeValue, 'phar://')) { return null; } // skip absolute paths - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($includeValue, '/')) { + if (\str_starts_with($includeValue, '/')) { return null; } // add preslash to string - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($includeValue, './')) { + if (\str_starts_with($includeValue, './')) { $node->expr->value = \RectorPrefix20210529\Nette\Utils\Strings::substring($includeValue, 1); } else { $node->expr->value = '/' . $includeValue; diff --git a/rules/CodingStyle/Application/UseImportsAdder.php b/rules/CodingStyle/Application/UseImportsAdder.php index 6807cd9478e2..b35a8086ed9e 100644 --- a/rules/CodingStyle/Application/UseImportsAdder.php +++ b/rules/CodingStyle/Application/UseImportsAdder.php @@ -122,6 +122,6 @@ private function isCurrentNamespace(string $namespaceName, \PHPStan\Type\ObjectT if (!$afterCurrentNamespace) { return \false; } - return !\RectorPrefix20210529\Nette\Utils\Strings::contains($afterCurrentNamespace, '\\'); + return \strpos($afterCurrentNamespace, '\\') === \false; } } diff --git a/rules/CodingStyle/ClassNameImport/ClassNameImportSkipVoter/AliasClassNameImportSkipVoter.php b/rules/CodingStyle/ClassNameImport/ClassNameImportSkipVoter/AliasClassNameImportSkipVoter.php index e7c1565565e7..d3fec058c66e 100644 --- a/rules/CodingStyle/ClassNameImport/ClassNameImportSkipVoter/AliasClassNameImportSkipVoter.php +++ b/rules/CodingStyle/ClassNameImport/ClassNameImportSkipVoter/AliasClassNameImportSkipVoter.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use Rector\CodingStyle\ClassNameImport\AliasUsesResolver; use Rector\CodingStyle\Contract\ClassNameImport\ClassNameImportSkipVoterInterface; @@ -33,7 +32,7 @@ public function shouldSkip(\Rector\StaticTypeMapper\ValueObject\Type\FullyQualif foreach ($aliasedUses as $aliasedUse) { $aliasedUseLowered = \strtolower($aliasedUse); // its aliased, we cannot just rename it - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($aliasedUseLowered, '\\' . $fullyQualifiedObjectType->getShortNameLowered())) { + if (\str_ends_with($aliasedUseLowered, '\\' . $fullyQualifiedObjectType->getShortNameLowered())) { return \true; } } diff --git a/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php b/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php index 48de405af689..65bdbea487b3 100644 --- a/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php +++ b/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\CodingStyle\ClassNameImport; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Name; use PhpParser\Node\Stmt\Use_; @@ -35,7 +34,7 @@ public function shouldSkipNameForFullyQualifiedObjectType(\PhpParser\Node $node, public function isShortNameInUseStatement(\PhpParser\Node\Name $name) : bool { $longName = $name->toString(); - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($longName, '\\')) { + if (\strpos($longName, '\\') !== \false) { return \false; } return $this->isFoundInUse($name); diff --git a/rules/CodingStyle/ClassNameImport/ShortNameResolver.php b/rules/CodingStyle/ClassNameImport/ShortNameResolver.php index d095cea96f14..d76c9f5a7b0e 100644 --- a/rules/CodingStyle/ClassNameImport/ShortNameResolver.php +++ b/rules/CodingStyle/ClassNameImport/ShortNameResolver.php @@ -138,7 +138,7 @@ private function resolveForStmts(array $stmts) : array return; } // already short - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($originalName->toString(), '\\')) { + if (\strpos($originalName->toString(), '\\') !== \false) { return; } $fullyQualifiedName = $this->nodeNameResolver->getName($node); @@ -190,7 +190,7 @@ private function resolveShortTagNameFromPhpDocChildNode(\PHPStan\PhpDocParser\As if (!$typeNode instanceof \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode) { return null; } - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($typeNode->name, '\\')) { + if (\strpos($typeNode->name, '\\') !== \false) { return null; } return $typeNode->name; diff --git a/rules/CodingStyle/Naming/ClassNaming.php b/rules/CodingStyle/Naming/ClassNaming.php index bd12dc496105..e1285599ffe7 100644 --- a/rules/CodingStyle/Naming/ClassNaming.php +++ b/rules/CodingStyle/Naming/ClassNaming.php @@ -69,7 +69,7 @@ public function createMethodNameFromFunction(\PhpParser\Node\Stmt\Function_ $fun } public function replaceSuffix(string $content, string $oldSuffix, string $newSuffix) : string { - if (!\RectorPrefix20210529\Nette\Utils\Strings::endsWith($content, $oldSuffix)) { + if (!\str_ends_with($content, $oldSuffix)) { return $content . $newSuffix; } $contentWithoutOldSuffix = \RectorPrefix20210529\Nette\Utils\Strings::substring($content, 0, -\RectorPrefix20210529\Nette\Utils\Strings::length($oldSuffix)); diff --git a/rules/CodingStyle/Node/NameImporter.php b/rules/CodingStyle/Node/NameImporter.php index 2283d40c7613..ee82999c27ac 100644 --- a/rules/CodingStyle/Node/NameImporter.php +++ b/rules/CodingStyle/Node/NameImporter.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\CodingStyle\Node; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Expr\FuncCall; @@ -146,7 +145,7 @@ private function isFunctionOrConstantImportWithSingleName(\PhpParser\Node\Name $ $parentNode = $name->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); $fullName = $name->toString(); $autoImportNames = $this->parameterProvider->provideParameter(\Rector\Core\Configuration\Option::AUTO_IMPORT_NAMES); - if ($autoImportNames && !$parentNode instanceof \PhpParser\Node && !\RectorPrefix20210529\Nette\Utils\Strings::contains($fullName, '\\') && $this->reflectionProvider->hasFunction(new \PhpParser\Node\Name($fullName), null)) { + if ($autoImportNames && !$parentNode instanceof \PhpParser\Node && \strpos($fullName, '\\') === \false && $this->reflectionProvider->hasFunction(new \PhpParser\Node\Name($fullName), null)) { return \true; } if ($parentNode instanceof \PhpParser\Node\Expr\ConstFetch) { diff --git a/rules/CodingStyle/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php b/rules/CodingStyle/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php index abc07ee67bf9..de6b3d4cb7d6 100644 --- a/rules/CodingStyle/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php +++ b/rules/CodingStyle/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php @@ -142,7 +142,7 @@ private function isJsonString(string $stringValue) : bool } try { return (bool) \RectorPrefix20210529\Nette\Utils\Json::decode($stringValue, \RectorPrefix20210529\Nette\Utils\Json::FORCE_ARRAY); - } catch (\RectorPrefix20210529\Nette\Utils\JsonException $jsonException) { + } catch (\RectorPrefix20210529\Nette\Utils\JsonException $exception) { return \false; } } diff --git a/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php b/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php index ab08a30139b2..31ef7141a1a1 100644 --- a/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php +++ b/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php @@ -72,7 +72,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node if ($docContent === '') { return null; } - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($docContent, '@var')) { + if (\strpos($docContent, '@var') === \false) { return null; } if (!$node->var instanceof \PhpParser\Node\Expr\Variable) { @@ -122,7 +122,7 @@ private function createDocComment(\PhpParser\Node $node) : \PhpParser\Comment\Do $docContent = $this->getDocContent($node); // normalize content // starts with "/*", instead of "/**" - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($docContent, '/* ')) { + if (\str_starts_with($docContent, '/* ')) { $docContent = \RectorPrefix20210529\Nette\Utils\Strings::replace($docContent, self::SINGLE_ASTERISK_COMMENT_START_REGEX, '/** '); } // $value is first, instead of type is first diff --git a/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php b/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php index f98a76c3df0b..4361c85b432d 100644 --- a/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php +++ b/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\CodingStyle\Rector\Encapsed; -use RectorPrefix20210529\Nette\Utils\Strings; use const PHP_EOL; use PhpParser\Node; use PhpParser\Node\Arg; @@ -107,7 +106,7 @@ private function createSprintfFuncCallOrConcat(string $string, array $argumentVa if ($string === '%s%s' && \count($argumentVariables) === 2 && $this->hasEndOfLine($argumentVariables)) { return new \PhpParser\Node\Expr\BinaryOp\Concat($argumentVariables[0], $argumentVariables[1]); } - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($string, \PHP_EOL)) { + if (\strpos($string, \PHP_EOL) !== \false) { return null; } $arguments = [new \PhpParser\Node\Arg(new \PhpParser\Node\Scalar\String_($string))]; diff --git a/rules/CodingStyle/Rector/FuncCall/PreslashSimpleFunctionRector.php b/rules/CodingStyle/Rector/FuncCall/PreslashSimpleFunctionRector.php index f1a969e2f798..171885e4d9ab 100644 --- a/rules/CodingStyle/Rector/FuncCall/PreslashSimpleFunctionRector.php +++ b/rules/CodingStyle/Rector/FuncCall/PreslashSimpleFunctionRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\CodingStyle\Rector\FuncCall; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Expr\FuncCall; use PhpParser\Node\Name\FullyQualified; @@ -58,7 +57,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node if ($functionName === null) { return null; } - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($functionName, '\\')) { + if (\strpos($functionName, '\\') !== \false) { return null; } $node->name = new \PhpParser\Node\Name\FullyQualified($functionName); diff --git a/rules/CodingStyle/Rector/Include_/FollowRequireByDirRector.php b/rules/CodingStyle/Rector/Include_/FollowRequireByDirRector.php index dd4883804c1e..dd24b463b9a0 100644 --- a/rules/CodingStyle/Rector/Include_/FollowRequireByDirRector.php +++ b/rules/CodingStyle/Rector/Include_/FollowRequireByDirRector.php @@ -64,7 +64,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node } private function isRefactorableStringPath(\PhpParser\Node\Scalar\String_ $string) : bool { - return !\RectorPrefix20210529\Nette\Utils\Strings::startsWith($string->value, 'phar://'); + return !\str_starts_with($string->value, 'phar://'); } private function prefixWithDir(\PhpParser\Node\Scalar\String_ $string) : \PhpParser\Node\Expr\BinaryOp\Concat { @@ -77,14 +77,14 @@ private function prefixWithDir(\PhpParser\Node\Scalar\String_ $string) : \PhpPar */ private function removeExtraDotSlash(\PhpParser\Node\Scalar\String_ $string) : void { - if (!\RectorPrefix20210529\Nette\Utils\Strings::startsWith($string->value, './')) { + if (!\str_starts_with($string->value, './')) { return; } $string->value = \RectorPrefix20210529\Nette\Utils\Strings::replace($string->value, '#^\\.\\/#', '/'); } private function prependSlashIfMissing(\PhpParser\Node\Scalar\String_ $string) : void { - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($string->value, '/')) { + if (\str_starts_with($string->value, '/')) { return; } $string->value = '/' . $string->value; diff --git a/rules/DependencyInjection/Rector/Variable/ReplaceVariableByPropertyFetchRector.php b/rules/DependencyInjection/Rector/Variable/ReplaceVariableByPropertyFetchRector.php index a7541fbd6332..b45de0fd73cb 100644 --- a/rules/DependencyInjection/Rector/Variable/ReplaceVariableByPropertyFetchRector.php +++ b/rules/DependencyInjection/Rector/Variable/ReplaceVariableByPropertyFetchRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\DependencyInjection\Rector\Variable; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Expr\Variable; use PhpParser\Node\Stmt\ClassMethod; @@ -102,7 +101,7 @@ private function isInControllerActionMethod(\PhpParser\Node\Expr\Variable $varia if ($className === null) { return \false; } - if (!\RectorPrefix20210529\Nette\Utils\Strings::endsWith($className, 'Controller')) { + if (!\str_ends_with($className, 'Controller')) { return \false; } $classMethod = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE); diff --git a/rules/DowngradePhp70/Rector/String_/DowngradeGeneratedScalarTypesRector.php b/rules/DowngradePhp70/Rector/String_/DowngradeGeneratedScalarTypesRector.php index 3137a40e45fe..38c5bca789e6 100644 --- a/rules/DowngradePhp70/Rector/String_/DowngradeGeneratedScalarTypesRector.php +++ b/rules/DowngradePhp70/Rector/String_/DowngradeGeneratedScalarTypesRector.php @@ -119,7 +119,7 @@ private function isRelevantFileInfo(\Symplify\SmartFileSystem\SmartFileInfo $fil return \true; } foreach (self::FILES_TO_INCLUDE as $fileToInclude) { - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($fileInfo->getRealPath(), $fileToInclude)) { + if (\str_ends_with($fileInfo->getRealPath(), $fileToInclude)) { return \true; } } diff --git a/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php b/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php index 175715a6bf0b..b7d9c431654e 100644 --- a/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php +++ b/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\DowngradePhp74\Rector\LNumber; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Scalar\DNumber; use PhpParser\Node\Scalar\LNumber; @@ -59,7 +58,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node } $numberNode = clone $node; $numberNodeValue = (string) $numberNode->value; - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($numberNodeValue, '+')) { + if (\strpos($numberNodeValue, '+') !== \false) { return null; } $node->value = (string) $node->value; @@ -70,7 +69,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node * by adding ".0" at the end (eg: 0.0). * Then, add it again. */ - if ($node instanceof \PhpParser\Node\Scalar\DNumber && !\RectorPrefix20210529\Nette\Utils\Strings::contains($node->value, '.')) { + if ($node instanceof \PhpParser\Node\Scalar\DNumber && \strpos($node->value, '.') === \false) { $node->value .= '.0'; } return $node; diff --git a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php index 44ae4d1a78a4..ffc0afe82d20 100644 --- a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php +++ b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\DowngradePhp80\Rector\Class_; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Attribute; use PhpParser\Node\Stmt\Class_; @@ -89,7 +88,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node continue; } unset($attrGroup->attrs[$key]); - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($attributeToAnnotation->getTag(), '\\')) { + if (\strpos($attributeToAnnotation->getTag(), '\\') === \false) { $phpDocInfo->addPhpDocTagNode(new \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode('@' . $attributeToAnnotation->getTag(), new \PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode(''))); } else { $doctrineAnnotation = $this->doctrineAnnotationFactory->createFromAttribute($attribute, $attributeToAnnotation->getTag()); diff --git a/rules/EarlyReturn/Rector/Foreach_/ReturnAfterToEarlyOnBreakRector.php b/rules/EarlyReturn/Rector/Foreach_/ReturnAfterToEarlyOnBreakRector.php index 1a3519a5fbd1..e15b5be4317e 100644 --- a/rules/EarlyReturn/Rector/Foreach_/ReturnAfterToEarlyOnBreakRector.php +++ b/rules/EarlyReturn/Rector/Foreach_/ReturnAfterToEarlyOnBreakRector.php @@ -94,7 +94,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node } return $this->nodeComparator->areNodesEqual($node, $assignVariable); }); - if ($this->shouldSkip($nextForeach, $variablePrevious, $node, $assignVariable)) { + if ($this->shouldSkip($nextForeach, $node, $assignVariable, $variablePrevious)) { return null; } /** @var Assign $assignPreviousVariable */ @@ -121,7 +121,7 @@ private function processEarlyReturn(\PhpParser\Node\Stmt\Expression $expression, $this->removeNode($assignPreviousVariable); return $foreach; } - private function shouldSkip(\PhpParser\Node\Stmt\Return_ $return, ?\PhpParser\Node\Expr $expr = null, \PhpParser\Node\Stmt\Foreach_ $foreach, \PhpParser\Node\Expr $assignVariable) : bool + private function shouldSkip(\PhpParser\Node\Stmt\Return_ $return, \PhpParser\Node\Stmt\Foreach_ $foreach, \PhpParser\Node\Expr $assignVariable, ?\PhpParser\Node\Expr $expr = null) : bool { if (!$expr instanceof \PhpParser\Node\Expr) { return \true; diff --git a/rules/Naming/Guard/BreakingVariableRenameGuard.php b/rules/Naming/Guard/BreakingVariableRenameGuard.php index 17ce4f417ad7..627003dd02f7 100644 --- a/rules/Naming/Guard/BreakingVariableRenameGuard.php +++ b/rules/Naming/Guard/BreakingVariableRenameGuard.php @@ -73,7 +73,8 @@ public function __construct(\Rector\Core\PhpParser\Node\BetterNodeFinder $better public function shouldSkipVariable(string $currentName, string $expectedName, \PhpParser\Node\FunctionLike $functionLike, \PhpParser\Node\Expr\Variable $variable) : bool { // is the suffix? → also accepted - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($currentName, \ucfirst($expectedName))) { + $expectedNameCamelCase = \ucfirst($expectedName); + if (\str_ends_with($currentName, $expectedNameCamelCase)) { return \true; } if ($this->conflictingNameResolver->checkNameIsInFunctionLike($expectedName, $functionLike)) { @@ -99,7 +100,8 @@ public function shouldSkipVariable(string $currentName, string $expectedName, \P public function shouldSkipParam(string $currentName, string $expectedName, \PhpParser\Node\Stmt\ClassMethod $classMethod, \PhpParser\Node\Param $param) : bool { // is the suffix? → also accepted - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($currentName, \ucfirst($expectedName))) { + $expectedNameCamelCase = \ucfirst($expectedName); + if (\str_ends_with($currentName, $expectedNameCamelCase)) { return \true; } $conflictingNames = $this->conflictingNameResolver->resolveConflictingVariableNamesForParam($classMethod); diff --git a/rules/Naming/Naming/PropertyNaming.php b/rules/Naming/Naming/PropertyNaming.php index 05e61241fb87..354c11499e9a 100644 --- a/rules/Naming/Naming/PropertyNaming.php +++ b/rules/Naming/Naming/PropertyNaming.php @@ -161,7 +161,7 @@ public function getExpectedNameFromBooleanPropertyType(\PhpParser\Node\Stmt\Prop } private function resolveShortClassName(string $className) : string { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($className, '\\')) { + if (\strpos($className, '\\') !== \false) { return (string) \RectorPrefix20210529\Nette\Utils\Strings::after($className, '\\', -1); } return $className; @@ -169,7 +169,7 @@ private function resolveShortClassName(string $className) : string private function removePrefixesAndSuffixes(string $shortClassName) : string { // is SomeInterface - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($shortClassName, self::INTERFACE)) { + if (\str_ends_with($shortClassName, self::INTERFACE)) { $shortClassName = \RectorPrefix20210529\Nette\Utils\Strings::substring($shortClassName, 0, -\strlen(self::INTERFACE)); } // is ISomeClass @@ -177,7 +177,7 @@ private function removePrefixesAndSuffixes(string $shortClassName) : string $shortClassName = \RectorPrefix20210529\Nette\Utils\Strings::substring($shortClassName, 1); } // is AbstractClass - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($shortClassName, 'Abstract')) { + if (\str_starts_with($shortClassName, 'Abstract')) { $shortClassName = \RectorPrefix20210529\Nette\Utils\Strings::substring($shortClassName, \strlen('Abstract')); } return $shortClassName; @@ -215,12 +215,12 @@ private function resolveClassName($objectType) : string } private function fqnToShortName(string $fqn) : string { - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($fqn, '\\')) { + if (\strpos($fqn, '\\') === \false) { return $fqn; } /** @var string $lastNamePart */ $lastNamePart = \RectorPrefix20210529\Nette\Utils\Strings::after($fqn, '\\', -1); - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($lastNamePart, self::INTERFACE)) { + if (\str_ends_with($lastNamePart, self::INTERFACE)) { return \RectorPrefix20210529\Nette\Utils\Strings::substring($lastNamePart, 0, -\strlen(self::INTERFACE)); } return $lastNamePart; @@ -235,7 +235,7 @@ private function removeInterfaceSuffixPrefix(string $className, string $shortNam if (\RectorPrefix20210529\Nette\Utils\Strings::match($shortName, self::I_PREFIX_REGEX)) { return \RectorPrefix20210529\Nette\Utils\Strings::substring($shortName, 1); } - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($shortName, self::INTERFACE)) { + if (\str_ends_with($shortName, self::INTERFACE)) { return \RectorPrefix20210529\Nette\Utils\Strings::substring($shortName, -\strlen(self::INTERFACE)); } return $shortName; @@ -270,7 +270,7 @@ private function isPrefixedInterface(string $shortClassName) : bool if (\strlen($shortClassName) <= 3) { return \false; } - if (!\RectorPrefix20210529\Nette\Utils\Strings::startsWith($shortClassName, 'I')) { + if (!\str_starts_with($shortClassName, 'I')) { return \false; } if (!\ctype_upper($shortClassName[1])) { diff --git a/rules/Naming/ParamRenamer/ParamRenamer.php b/rules/Naming/ParamRenamer/ParamRenamer.php index 21d50cda3b05..dd4870d569d0 100644 --- a/rules/Naming/ParamRenamer/ParamRenamer.php +++ b/rules/Naming/ParamRenamer/ParamRenamer.php @@ -27,7 +27,7 @@ public function rename(\Rector\Naming\ValueObject\ParamRename $paramRename) : vo // 1. rename param $paramRename->getVariable()->name = $paramRename->getExpectedName(); // 2. rename param in the rest of the method - $this->variableRenamer->renameVariableInFunctionLike($paramRename->getFunctionLike(), null, $paramRename->getCurrentName(), $paramRename->getExpectedName()); + $this->variableRenamer->renameVariableInFunctionLike($paramRename->getFunctionLike(), $paramRename->getCurrentName(), $paramRename->getExpectedName(), null); // 3. rename @param variable in docblock too $this->propertyDocBlockManipulator->renameParameterNameInDocBlock($paramRename); } diff --git a/rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php b/rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php index 0d3391d3a964..84eb3c770592 100644 --- a/rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php +++ b/rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php @@ -188,7 +188,7 @@ private function renameVariable(\Rector\Naming\ValueObject\VariableAndCallAssign $assign = $variableAndCallAssign->getAssign(); $assignPhpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($assign); $this->varTagValueNodeRenamer->renameAssignVarTagVariableName($assignPhpDocInfo, $variableAndCallAssign->getVariableName(), $expectedName); - $this->variableRenamer->renameVariableInFunctionLike($variableAndCallAssign->getFunctionLike(), $variableAndCallAssign->getAssign(), $variableAndCallAssign->getVariableName(), $expectedName); + $this->variableRenamer->renameVariableInFunctionLike($variableAndCallAssign->getFunctionLike(), $variableAndCallAssign->getVariableName(), $expectedName, $variableAndCallAssign->getAssign()); } /** * @param StaticCall|MethodCall|FuncCall $expr diff --git a/rules/Naming/Rector/ClassMethod/RenameVariableToMatchNewTypeRector.php b/rules/Naming/Rector/ClassMethod/RenameVariableToMatchNewTypeRector.php index ebe460604c74..224a970517a1 100644 --- a/rules/Naming/Rector/ClassMethod/RenameVariableToMatchNewTypeRector.php +++ b/rules/Naming/Rector/ClassMethod/RenameVariableToMatchNewTypeRector.php @@ -96,7 +96,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node // 1. rename assigned variable $assignOfNew->var = new \PhpParser\Node\Expr\Variable($expectedName); // 2. rename variable in the - $this->variableRenamer->renameVariableInFunctionLike($node, $assignOfNew, $currentName, $expectedName); + $this->variableRenamer->renameVariableInFunctionLike($node, $currentName, $expectedName, $assignOfNew); } if (!$hasChanged) { return null; diff --git a/rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php b/rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php index a21abd071b54..8aed38ad026e 100644 --- a/rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php +++ b/rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php @@ -113,6 +113,6 @@ private function shouldSkip(\Rector\Naming\ValueObject\VariableAndCallForeach $v } private function renameVariable(\Rector\Naming\ValueObject\VariableAndCallForeach $variableAndCallForeach, string $expectedName) : void { - $this->variableRenamer->renameVariableInFunctionLike($variableAndCallForeach->getFunctionLike(), null, $variableAndCallForeach->getVariableName(), $expectedName); + $this->variableRenamer->renameVariableInFunctionLike($variableAndCallForeach->getFunctionLike(), $variableAndCallForeach->getVariableName(), $expectedName, null); } } diff --git a/rules/Naming/VariableRenamer.php b/rules/Naming/VariableRenamer.php index c99c1eaf2e06..098b096543dc 100644 --- a/rules/Naming/VariableRenamer.php +++ b/rules/Naming/VariableRenamer.php @@ -51,7 +51,7 @@ public function __construct(\RectorPrefix20210529\Symplify\Astral\NodeTraverser\ /** * @param ClassMethod|Function_|Closure $functionLike */ - public function renameVariableInFunctionLike(\PhpParser\Node\FunctionLike $functionLike, ?\PhpParser\Node\Expr\Assign $assign = null, string $oldName, string $expectedName) : void + public function renameVariableInFunctionLike(\PhpParser\Node\FunctionLike $functionLike, string $oldName, string $expectedName, ?\PhpParser\Node\Expr\Assign $assign = null) : void { $isRenamingActive = \false; if ($assign === null) { diff --git a/rules/PHPOffice/Rector/StaticCall/AddRemovedDefaultValuesRector.php b/rules/PHPOffice/Rector/StaticCall/AddRemovedDefaultValuesRector.php index a2ddb353efb7..b6309d7d1f84 100644 --- a/rules/PHPOffice/Rector/StaticCall/AddRemovedDefaultValuesRector.php +++ b/rules/PHPOffice/Rector/StaticCall/AddRemovedDefaultValuesRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\PHPOffice\Rector\StaticCall; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr\MethodCall; @@ -80,7 +79,7 @@ private function refactorArgs(\PhpParser\Node $node, array $defaultValuesByPosit if (isset($node->args[$position])) { continue; } - if (\is_string($defaultValue) && \RectorPrefix20210529\Nette\Utils\Strings::contains($defaultValue, '::')) { + if (\is_string($defaultValue) && \strpos($defaultValue, '::') !== \false) { [$className, $constant] = \explode('::', $defaultValue); $classConstant = $this->nodeFactory->createClassConstFetch($className, $constant); $arg = new \PhpParser\Node\Arg($classConstant); diff --git a/rules/PSR4/Composer/PSR4NamespaceMatcher.php b/rules/PSR4/Composer/PSR4NamespaceMatcher.php index 0d7403cbd83a..5170dd7cfe04 100644 --- a/rules/PSR4/Composer/PSR4NamespaceMatcher.php +++ b/rules/PSR4/Composer/PSR4NamespaceMatcher.php @@ -27,7 +27,7 @@ public function getExpectedNamespace(\Rector\Core\ValueObject\Application\File $ $paths = \is_array($path) ? $path : [$path]; foreach ($paths as $path) { $path = \rtrim($path, '/'); - if (!\RectorPrefix20210529\Nette\Utils\Strings::startsWith($smartFileInfo->getRelativeDirectoryPath(), $path)) { + if (!\str_starts_with($smartFileInfo->getRelativeDirectoryPath(), $path)) { continue; } $expectedNamespace = $namespace . $this->resolveExtraNamespace($smartFileInfo, $path); diff --git a/rules/PSR4/FileRelocationResolver.php b/rules/PSR4/FileRelocationResolver.php index dffc8cb7e8ec..70933bf03253 100644 --- a/rules/PSR4/FileRelocationResolver.php +++ b/rules/PSR4/FileRelocationResolver.php @@ -54,7 +54,7 @@ public function resolveNewFileLocationFromOldClassToNewClass(\Symplify\SmartFile */ private function resolveRootDirectory(\Symplify\SmartFileSystem\SmartFileInfo $smartFileInfo, string $suffixName, array $groupNames) : string { - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($smartFileInfo->getRealPathDirectory(), '/tmp')) { + if (\str_starts_with($smartFileInfo->getRealPathDirectory(), '/tmp')) { $currentTraversePath = $smartFileInfo->getRealPathDirectory(); } else { $currentTraversePath = $smartFileInfo->getRelativeDirectoryPath(); diff --git a/rules/Php55/RegexMatcher.php b/rules/Php55/RegexMatcher.php index 878d667b6641..e1445c0d7cf6 100644 --- a/rules/Php55/RegexMatcher.php +++ b/rules/Php55/RegexMatcher.php @@ -42,7 +42,7 @@ public function resolvePatternExpressionWithoutEIfFound(\PhpParser\Node\Expr $ex } /** @var string $modifiers */ $modifiers = \RectorPrefix20210529\Nette\Utils\Strings::after($pattern, $delimiter, -1); - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($modifiers, 'e')) { + if (\strpos($modifiers, 'e') === \false) { return null; } $patternWithoutE = $this->createPatternWithoutE($pattern, $delimiter, $modifiers); @@ -68,7 +68,7 @@ private function matchConcat(\PhpParser\Node\Expr\BinaryOp\Concat $concat) : ?\P if (!isset($matches['modifiers'])) { return null; } - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($matches['modifiers'], 'e')) { + if (\strpos($matches['modifiers'], 'e') === \false) { return null; } // replace last "e" in the code diff --git a/rules/Php70/EregToPcreTransformer.php b/rules/Php70/EregToPcreTransformer.php index e668738c1a49..77d927febbdc 100644 --- a/rules/Php70/EregToPcreTransformer.php +++ b/rules/Php70/EregToPcreTransformer.php @@ -68,7 +68,7 @@ public function __construct(string $pcreDelimiter = '#') } public function transform(string $ereg, bool $isCaseInsensitive) : string { - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($ereg, $this->pcreDelimiter)) { + if (\strpos($ereg, $this->pcreDelimiter) === \false) { return $this->ere2pcre($ereg, $isCaseInsensitive); } // fallback @@ -132,7 +132,7 @@ private function _ere2pcre(string $content, int $i) : array } elseif ($char === '*' || $char === '+' || $char === '?') { throw new \Rector\Php70\Exception\InvalidEregException('unescaped metacharacter "' . $char . '"'); } elseif ($char === '{') { - if ($i + 1 < $l && \RectorPrefix20210529\Nette\Utils\Strings::contains('0123456789', $content[$i + 1])) { + if ($i + 1 < $l && \strpos('0123456789', $content[$i + 1]) !== \false) { $r[$rr] .= '\\{'; } else { throw new \Rector\Php70\Exception\InvalidEregException('unescaped metacharacter "' . $char . '"'); @@ -205,7 +205,7 @@ private function processBracket(string $content, int $i, int $l, array &$r, int private function processSquareBracket(string $s, int $i, int $l, string $cls, bool $start) : array { do { - if ($s[$i] === '[' && $i + 1 < $l && \RectorPrefix20210529\Nette\Utils\Strings::contains('.=:', $s[$i + 1])) { + if ($s[$i] === '[' && $i + 1 < $l && \strpos('.=:', $s[$i + 1]) !== \false) { /** @var string $cls */ [$cls, $i] = $this->processCharacterClass($s, $i, $cls); } else { @@ -237,7 +237,7 @@ private function _ere2pcre_escape(string $content) : string if ($content === "\0") { throw new \Rector\Php70\Exception\InvalidEregException('a literal null byte in the regex'); } - if (\RectorPrefix20210529\Nette\Utils\Strings::contains('\\^$.[]|()?*+{}-/', $content)) { + if (\strpos('\\^$.[]|()?*+{}-/', $content) !== \false) { return '\\' . $content; } return $content; diff --git a/rules/Php70/NodeAnalyzer/VariableNaming.php b/rules/Php70/NodeAnalyzer/VariableNaming.php index 6ba330daec26..4258f55678d4 100644 --- a/rules/Php70/NodeAnalyzer/VariableNaming.php +++ b/rules/Php70/NodeAnalyzer/VariableNaming.php @@ -56,7 +56,7 @@ public function resolveFromNodeWithScopeCountAndFallbackName(\PhpParser\Node\Exp if ($name === null) { $name = $fallbackName; } - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($name, '\\')) { + if (\strpos($name, '\\') !== \false) { $name = (string) \RectorPrefix20210529\Nette\Utils\Strings::after($name, '\\', -1); } $countedValueName = $this->createCountedValueName($name, $scope); diff --git a/rules/Php70/Rector/FuncCall/EregToPregMatchRector.php b/rules/Php70/Rector/FuncCall/EregToPregMatchRector.php index f25fba1f3601..b767863d44a1 100644 --- a/rules/Php70/Rector/FuncCall/EregToPregMatchRector.php +++ b/rules/Php70/Rector/FuncCall/EregToPregMatchRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Php70\Rector\FuncCall; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr\ArrayDimFetch; @@ -101,7 +100,7 @@ private function processVariablePattern(\PhpParser\Node\Expr\FuncCall $funcCall, */ private function processSplitLimitArgument(\PhpParser\Node\Expr\FuncCall $funcCall, string $functionName) : void { - if (!\RectorPrefix20210529\Nette\Utils\Strings::startsWith($functionName, 'split')) { + if (!\str_starts_with($functionName, 'split')) { return; } // 3rd argument - $limit, 0 → 1 @@ -126,9 +125,9 @@ private function createTernaryWithStrlenOfFirstMatch(\PhpParser\Node\Expr\FuncCa } private function isCaseInsensitiveFunction(string $functionName) : bool { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($functionName, 'eregi')) { + if (\strpos($functionName, 'eregi') !== \false) { return \true; } - return \RectorPrefix20210529\Nette\Utils\Strings::contains($functionName, 'spliti'); + return \strpos($functionName, 'spliti') !== \false; } } diff --git a/rules/Php73/Rector/String_/SensitiveHereNowDocRector.php b/rules/Php73/Rector/String_/SensitiveHereNowDocRector.php index 769495ded802..9183d3321c3d 100644 --- a/rules/Php73/Rector/String_/SensitiveHereNowDocRector.php +++ b/rules/Php73/Rector/String_/SensitiveHereNowDocRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Php73\Rector\String_; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Scalar\String_; use Rector\Core\Rector\AbstractRector; @@ -57,7 +56,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node // the doc label is not in the string → ok /** @var string $docLabel */ $docLabel = $node->getAttribute(self::ATTRIBUTE_DOC_LABEL); - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($node->value, $docLabel)) { + if (\strpos($node->value, $docLabel) === \false) { return null; } $node->setAttribute(self::ATTRIBUTE_DOC_LABEL, $this->uniquateDocLabel($node->value, $docLabel)); @@ -70,7 +69,7 @@ private function uniquateDocLabel(string $value, string $docLabel) : string $docLabel .= self::WRAP_SUFFIX; $docLabelCounterTemplate = $docLabel . '_%d'; $i = 0; - while (\RectorPrefix20210529\Nette\Utils\Strings::contains($value, $docLabel)) { + while (\strpos($value, $docLabel) !== \false) { $docLabel = \sprintf($docLabelCounterTemplate, ++$i); } return $docLabel; diff --git a/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php b/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php index 3fabaa5f6432..db0e4f2000ee 100644 --- a/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php +++ b/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php @@ -90,7 +90,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node if ($this->shouldSkip($node, $numericValueAsString)) { return null; } - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($numericValueAsString, '.')) { + if (\strpos($numericValueAsString, '.') !== \false) { [$mainPart, $decimalPart] = \explode('.', $numericValueAsString); $chunks = $this->strSplitNegative($mainPart, self::GROUP_SIZE); $literalSeparatedNumber = \implode('_', $chunks) . '.' . $decimalPart; @@ -114,7 +114,7 @@ private function shouldSkip(\PhpParser\Node $node, string $numericValueAsString) return \true; } // already separated - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($numericValueAsString, '_')) { + if (\strpos($numericValueAsString, '_') !== \false) { return \true; } $kind = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::KIND); diff --git a/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php b/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php index 5470f150c2df..9bf105e5c6a0 100644 --- a/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php +++ b/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php @@ -104,7 +104,7 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node $propertyName = $this->getName($property->props[0]); /** @var string $oldName */ $oldName = $this->getName($param->var); - $this->variableRenamer->renameVariableInFunctionLike($constructClassMethod, null, $oldName, $propertyName); + $this->variableRenamer->renameVariableInFunctionLike($constructClassMethod, $oldName, $propertyName, null); $paramTagValueNode = $classMethodPhpDocInfo->getParamTagValueNodeByName($paramName); if (!$paramTagValueNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode) { $this->decorateParamWithPropertyPhpDocInfo($property, $param); diff --git a/rules/PhpSpecToPHPUnit/Naming/PhpSpecRenaming.php b/rules/PhpSpecToPHPUnit/Naming/PhpSpecRenaming.php index 9f922442b2b0..044bdbd39deb 100644 --- a/rules/PhpSpecToPHPUnit/Naming/PhpSpecRenaming.php +++ b/rules/PhpSpecToPHPUnit/Naming/PhpSpecRenaming.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\PhpSpecToPHPUnit\Naming; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Identifier; use PhpParser\Node\Name; @@ -51,7 +50,7 @@ public function renameMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod) : vo // from PhpSpec to PHPUnit method naming convention $classMethodName = $this->stringFormatConverter->underscoreAndHyphenToCamelCase($classMethodName); // add "test", so PHPUnit runs the method - if (!\RectorPrefix20210529\Nette\Utils\Strings::startsWith($classMethodName, 'test')) { + if (!\str_starts_with($classMethodName, 'test')) { $classMethodName = 'test' . \ucfirst($classMethodName); } $classMethod->name = new \PhpParser\Node\Identifier($classMethodName); diff --git a/rules/PhpSpecToPHPUnit/Rector/ClassMethod/PhpSpecMethodToPHPUnitMethodRector.php b/rules/PhpSpecToPHPUnit/Rector/ClassMethod/PhpSpecMethodToPHPUnitMethodRector.php index 32ab677968e9..04f91a6ed7e3 100644 --- a/rules/PhpSpecToPHPUnit/Rector/ClassMethod/PhpSpecMethodToPHPUnitMethodRector.php +++ b/rules/PhpSpecToPHPUnit/Rector/ClassMethod/PhpSpecMethodToPHPUnitMethodRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\PhpSpecToPHPUnit\Rector\ClassMethod; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Identifier; use PhpParser\Node\Stmt\ClassMethod; @@ -68,7 +67,7 @@ private function processTestMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod // reorder instantiation + expected exception $previousStmt = null; foreach ((array) $classMethod->stmts as $key => $stmt) { - if ($previousStmt && \RectorPrefix20210529\Nette\Utils\Strings::contains($this->print($stmt), 'duringInstantiation') && \RectorPrefix20210529\Nette\Utils\Strings::contains($this->print($previousStmt), 'beConstructedThrough')) { + if ($previousStmt && \strpos($this->print($stmt), 'duringInstantiation') !== \false && \strpos($this->print($previousStmt), 'beConstructedThrough') !== \false) { $classMethod->stmts[$key - 1] = $stmt; $classMethod->stmts[$key] = $previousStmt; } diff --git a/rules/RemovingStatic/UniqueObjectFactoryFactory.php b/rules/RemovingStatic/UniqueObjectFactoryFactory.php index 2b3f10975257..cd91bb078bdf 100644 --- a/rules/RemovingStatic/UniqueObjectFactoryFactory.php +++ b/rules/RemovingStatic/UniqueObjectFactoryFactory.php @@ -84,7 +84,7 @@ public function createFactoryClass(\PhpParser\Node\Stmt\Class_ $class, \PHPStan\ } private function resolveClassShortName(string $name) : string { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($name, '\\')) { + if (\strpos($name, '\\') !== \false) { return (string) \RectorPrefix20210529\Nette\Utils\Strings::after($name, '\\', -1); } return $name; diff --git a/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php b/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php index d59a55875b4b..898c78969c51 100644 --- a/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php +++ b/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Renaming\Rector\FuncCall; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Expr\FuncCall; use PhpParser\Node\Name; @@ -59,7 +58,7 @@ public function configure(array $configuration) : void } private function createName(string $newFunction) : \PhpParser\Node\Name { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($newFunction, '\\')) { + if (\strpos($newFunction, '\\') !== \false) { return new \PhpParser\Node\Name\FullyQualified($newFunction); } return new \PhpParser\Node\Name($newFunction); diff --git a/rules/TypeDeclaration/PHPStan/Type/ObjectTypeSpecifier.php b/rules/TypeDeclaration/PHPStan/Type/ObjectTypeSpecifier.php index 15fc11b5fd64..677867798661 100644 --- a/rules/TypeDeclaration/PHPStan/Type/ObjectTypeSpecifier.php +++ b/rules/TypeDeclaration/PHPStan/Type/ObjectTypeSpecifier.php @@ -145,7 +145,7 @@ private function matchSameNamespacedObjectType(\PhpParser\Node $node, \PHPStan\T private function matchPartialNamespaceObjectType(\PHPStan\Type\ObjectType $objectType, \PhpParser\Node\Stmt\UseUse $useUse) : ?\Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType { // partial namespace - if (!\RectorPrefix20210529\Nette\Utils\Strings::startsWith($objectType->getClassName(), $useUse->name->getLast() . '\\')) { + if (!\str_starts_with($objectType->getClassName(), $useUse->name->getLast() . '\\')) { return null; } $classNameWithoutLastUsePart = \RectorPrefix20210529\Nette\Utils\Strings::after($objectType->getClassName(), '\\', 1); diff --git a/rules/TypeDeclaration/PhpDocParser/NonInformativeReturnTagRemover.php b/rules/TypeDeclaration/PhpDocParser/NonInformativeReturnTagRemover.php index ad6a80a397fc..eaa8c00839e2 100644 --- a/rules/TypeDeclaration/PhpDocParser/NonInformativeReturnTagRemover.php +++ b/rules/TypeDeclaration/PhpDocParser/NonInformativeReturnTagRemover.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\TypeDeclaration\PhpDocParser; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node\FunctionLike; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Function_; @@ -113,7 +112,7 @@ private function removeNullableType(\PHPStan\Type\Type $returnType, \PHPStan\Php if (!$nullabledReturnTagValueNode instanceof \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode) { return; } - if (!\RectorPrefix20210529\Nette\Utils\Strings::endsWith($nullabledReturnType->getClassName(), $nullabledReturnTagValueNode->name)) { + if (!\str_ends_with($nullabledReturnType->getClassName(), $nullabledReturnTagValueNode->name)) { return; } $phpDocInfo->removeByType(\PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode::class); @@ -185,6 +184,6 @@ private function isClassNameAndPartMatch(string $className, string $returnTagVal if ('\\' . $className === $returnTagValueNodeType) { return \true; } - return \RectorPrefix20210529\Nette\Utils\Strings::endsWith($className, '\\' . $returnTagValueNodeType); + return \str_ends_with($className, '\\' . $returnTagValueNodeType); } } diff --git a/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/ConstructorPropertyTypeInferer.php b/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/ConstructorPropertyTypeInferer.php index 0fb5257dd0f0..b99d076463c4 100644 --- a/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/ConstructorPropertyTypeInferer.php +++ b/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/ConstructorPropertyTypeInferer.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Expr\Variable; use PhpParser\Node\Name; @@ -181,7 +180,7 @@ private function resolveFullyQualifiedOrAliasedObjectType(\PhpParser\Node\Param return null; } // if the FQN has different ending than the original, it was aliased and we need to return the alias - if (!\RectorPrefix20210529\Nette\Utils\Strings::endsWith($fullyQualifiedName, '\\' . $originalName->toString())) { + if (!\str_ends_with($fullyQualifiedName, '\\' . $originalName->toString())) { $className = $originalName->toString(); if ($this->reflectionProvider->hasClass($className)) { return new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($className); diff --git a/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php b/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php index f79e2a1b7575..5e1cf3752496 100644 --- a/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php +++ b/rules/TypeDeclaration/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php @@ -81,7 +81,7 @@ private function processToOneRelation(\PhpParser\Node\Stmt\Property $property, \ if ($targetEntity === null) { return new \PHPStan\Type\MixedType(); } - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($targetEntity, '::class')) { + if (\str_ends_with($targetEntity, '::class')) { $targetEntity = \RectorPrefix20210529\Nette\Utils\Strings::before($targetEntity, '::class'); } // resolve to FQN diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 35be2a80fb6a..a17266070b16 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = '763bce6c57f4ad1b3a6c421ce0a56d9219f1c9e2'; + public const PACKAGE_VERSION = 'b90952fdeb81cce5dce10b34f97490701cc0537c'; /** * @var string */ - public const RELEASE_DATE = '2021-05-29 22:02:52'; + public const RELEASE_DATE = '2021-05-30 00:00:30'; public static function resolvePackageVersion() : string { $process = new \RectorPrefix20210529\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); diff --git a/src/Configuration/Configuration.php b/src/Configuration/Configuration.php index cf65867659ab..c0232fbaf199 100644 --- a/src/Configuration/Configuration.php +++ b/src/Configuration/Configuration.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\Configuration; -use RectorPrefix20210529\Nette\Utils\Strings; use Rector\ChangesReporting\Output\ConsoleOutputFormatter; use Rector\Core\Exception\Configuration\InvalidConfigurationException; use Rector\Core\ValueObject\Bootstrap\BootstrapConfigs; @@ -199,7 +198,7 @@ private function correctBashSpacePaths(array $commandLinePaths) : array { // fixes bash edge-case that to merges string with space to one foreach ($commandLinePaths as $commandLinePath) { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($commandLinePath, ' ')) { + if (\strpos($commandLinePath, ' ') !== \false) { $commandLinePaths = \explode(' ', $commandLinePath); } } diff --git a/src/Console/Command/ProcessCommand.php b/src/Console/Command/ProcessCommand.php index 6aaee497a820..a090d0b852bb 100644 --- a/src/Console/Command/ProcessCommand.php +++ b/src/Console/Command/ProcessCommand.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\Console\Command; -use RectorPrefix20210529\Nette\Utils\Strings; use PHPStan\Analyser\NodeScopeResolver; use Rector\Caching\Detector\ChangedFilesDetector; use Rector\ChangesReporting\Output\ConsoleOutputFormatter; @@ -181,7 +180,7 @@ private function configurePHPStanNodeScopeResolver(array $files) : void foreach ($files as $file) { $smartFileInfo = $file->getSmartFileInfo(); $pathName = $smartFileInfo->getPathname(); - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($pathName, '.php')) { + if (\str_ends_with($pathName, '.php')) { $filePaths[] = $pathName; } } diff --git a/src/DependencyInjection/CompilerPass/VerifyRectorServiceExistsCompilerPass.php b/src/DependencyInjection/CompilerPass/VerifyRectorServiceExistsCompilerPass.php index 3677b1abdf7e..75ea2f52b14a 100644 --- a/src/DependencyInjection/CompilerPass/VerifyRectorServiceExistsCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/VerifyRectorServiceExistsCompilerPass.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\DependencyInjection\CompilerPass; -use RectorPrefix20210529\Nette\Utils\Strings; use Rector\Core\Contract\Rector\RectorInterface; use Rector\Core\Exception\ShouldNotHappenException; use RectorPrefix20210529\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; @@ -17,7 +16,7 @@ public function process(\RectorPrefix20210529\Symfony\Component\DependencyInject if ($class === null) { continue; } - if (!\RectorPrefix20210529\Nette\Utils\Strings::endsWith($class, 'Rector')) { + if (!\str_ends_with($class, 'Rector')) { continue; } if (!\is_a($class, \Rector\Core\Contract\Rector\RectorInterface::class, \true)) { diff --git a/src/FileSystem/FilesystemTweaker.php b/src/FileSystem/FilesystemTweaker.php index 7ad84ec4d2ce..5d75c47113ec 100644 --- a/src/FileSystem/FilesystemTweaker.php +++ b/src/FileSystem/FilesystemTweaker.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\FileSystem; -use RectorPrefix20210529\Nette\Utils\Strings; use RectorPrefix20210529\Symplify\SmartFileSystem\FileSystemGuard; final class FilesystemTweaker { @@ -26,7 +25,7 @@ public function resolveDirectoriesWithFnmatch(array $directories) : array $absoluteDirectories = []; foreach ($directories as $directory) { // is fnmatch for directories - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($directory, '*')) { + if (\strpos($directory, '*') !== \false) { $foundDirectories = $this->findDirectoriesInGlob($directory); $absoluteDirectories = \array_merge($absoluteDirectories, $foundDirectories); } else { @@ -48,7 +47,7 @@ public function resolveWithFnmatch(array $paths) : array { $absolutePathsFound = []; foreach ($paths as $path) { - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($path, '*')) { + if (\strpos($path, '*') !== \false) { $foundPaths = $this->foundInGlob($path); $absolutePathsFound = \array_merge($absolutePathsFound, $foundPaths); } else { diff --git a/src/FileSystem/PhpFilesFinder.php b/src/FileSystem/PhpFilesFinder.php index 073ef8c68837..7b5429d79704 100644 --- a/src/FileSystem/PhpFilesFinder.php +++ b/src/FileSystem/PhpFilesFinder.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\FileSystem; -use RectorPrefix20210529\Nette\Utils\Strings; use Rector\Caching\Application\CachedFileInfoFilterAndReporter; use Rector\Core\Configuration\Configuration; use Symplify\SmartFileSystem\SmartFileInfo; @@ -36,7 +35,7 @@ public function findInPaths(array $paths) : array $phpFileInfos = $this->filesFinder->findInDirectoriesAndFiles($paths, $this->configuration->getFileExtensions()); // filter out non-PHP php files, e.g. blade templates in Laravel $phpFileInfos = \array_filter($phpFileInfos, function (\Symplify\SmartFileSystem\SmartFileInfo $smartFileInfo) : bool { - return !\RectorPrefix20210529\Nette\Utils\Strings::endsWith($smartFileInfo->getPathname(), '.blade.php'); + return !\str_ends_with($smartFileInfo->getPathname(), '.blade.php'); }); return $this->cachedFileInfoFilterAndReporter->filterFileInfos($phpFileInfos); } diff --git a/src/NodeManipulator/VariableManipulator.php b/src/NodeManipulator/VariableManipulator.php index 8d13e2552d4c..0d1d3f43527d 100644 --- a/src/NodeManipulator/VariableManipulator.php +++ b/src/NodeManipulator/VariableManipulator.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\NodeManipulator; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr\Array_; @@ -101,7 +100,7 @@ private function isTestCaseExpectedVariable(\PhpParser\Node\Expr\Variable $varia { /** @var string $className */ $className = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CLASS_NAME); - if (!\RectorPrefix20210529\Nette\Utils\Strings::endsWith($className, 'Test')) { + if (!\str_ends_with($className, 'Test')) { return \false; } return $this->nodeNameResolver->isName($variable, 'expect*'); diff --git a/src/NonPhpFile/NonPhpFileProcessor.php b/src/NonPhpFile/NonPhpFileProcessor.php index 446e5fbbe64f..b5aca2c9db6a 100644 --- a/src/NonPhpFile/NonPhpFileProcessor.php +++ b/src/NonPhpFile/NonPhpFileProcessor.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\NonPhpFile; -use RectorPrefix20210529\Nette\Utils\Strings; use Rector\Core\Contract\Processor\FileProcessorInterface; use Rector\Core\Contract\Rector\NonPhpRectorInterface; use Rector\Core\ValueObject\Application\File; @@ -38,7 +37,7 @@ public function supports(\Rector\Core\ValueObject\Application\File $file) : bool $smartFileInfo = $file->getSmartFileInfo(); // bug in path extension foreach ($this->getSupportedFileExtensions() as $supportedFileExtension) { - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($smartFileInfo->getPathname(), '.' . $supportedFileExtension)) { + if (\str_ends_with($smartFileInfo->getPathname(), '.' . $supportedFileExtension)) { return \true; } } diff --git a/src/NonPhpFile/Rector/RenameClassNonPhpRector.php b/src/NonPhpFile/Rector/RenameClassNonPhpRector.php index 226d233016ea..89484c7c441b 100644 --- a/src/NonPhpFile/Rector/RenameClassNonPhpRector.php +++ b/src/NonPhpFile/Rector/RenameClassNonPhpRector.php @@ -95,7 +95,7 @@ private function addDoubleSlahed(array $classRenames) : array { foreach ($classRenames as $oldClass => $newClass) { // to prevent no slash override - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($oldClass, '\\')) { + if (\strpos($oldClass, '\\') === \false) { continue; } $doubleSlashOldClass = \str_replace('\\', '\\\\', $oldClass); @@ -113,7 +113,7 @@ private function getRenameClasses() : array } private function createOldClassRegex(string $oldClass) : string { - if (!\RectorPrefix20210529\Nette\Utils\Strings::contains($oldClass, '\\')) { + if (\strpos($oldClass, '\\') === \false) { return self::STANDALONE_CLASS_PREFIX_REGEX . \preg_quote($oldClass, '#') . self::STANDALONE_CLASS_SUFFIX_REGEX; } return '#' . \preg_quote($oldClass, '#') . '#'; diff --git a/src/PhpParser/Node/Value/ValueResolver.php b/src/PhpParser/Node/Value/ValueResolver.php index 0a0b2d55f0d5..d277c8f221ba 100644 --- a/src/PhpParser/Node/Value/ValueResolver.php +++ b/src/PhpParser/Node/Value/ValueResolver.php @@ -85,7 +85,7 @@ public function getValue(\PhpParser\Node\Expr $expr, bool $resolvedClassReferenc try { $constExprEvaluator = $this->getConstExprEvaluator(); $value = $constExprEvaluator->evaluateDirectly($expr); - } catch (\PhpParser\ConstExprEvaluationException $constExprEvaluationException) { + } catch (\PhpParser\ConstExprEvaluationException $exception) { $value = null; } if ($value !== null) { diff --git a/src/Reflection/MethodReflectionToAstResolver.php b/src/Reflection/MethodReflectionToAstResolver.php index 12a6ce47856f..2354d54fe488 100644 --- a/src/Reflection/MethodReflectionToAstResolver.php +++ b/src/Reflection/MethodReflectionToAstResolver.php @@ -3,7 +3,6 @@ declare (strict_types=1); namespace Rector\Core\Reflection; -use RectorPrefix20210529\Nette\Utils\Strings; use PhpParser\Node; use PhpParser\Node\Stmt\ClassMethod; use PHPStan\Reflection\Php\PhpMethodReflection; @@ -43,7 +42,7 @@ public function resolveProjectClassMethod(\PHPStan\Reflection\Php\PhpMethodRefle return null; } // skip vendor - if (\RectorPrefix20210529\Nette\Utils\Strings::contains($fileName, '#\\/vendor\\/#')) { + if (\strpos($fileName, '#\\/vendor\\/#') !== \false) { return null; } $methodName = $phpMethodReflection->getName(); diff --git a/src/Template/DefaultResolver.php b/src/Template/DefaultResolver.php index ad8403f26529..a0bd767d13b2 100644 --- a/src/Template/DefaultResolver.php +++ b/src/Template/DefaultResolver.php @@ -4,6 +4,7 @@ namespace Rector\Core\Template; use Rector\Core\Contract\Template\TemplateResolverInterface; +use Stringable; final class DefaultResolver implements \Rector\Core\Contract\Template\TemplateResolverInterface { /** diff --git a/src/Util/StaticRectorStrings.php b/src/Util/StaticRectorStrings.php index 62748904b958..9c9057c44601 100644 --- a/src/Util/StaticRectorStrings.php +++ b/src/Util/StaticRectorStrings.php @@ -4,9 +4,6 @@ namespace Rector\Core\Util; use RectorPrefix20210529\Nette\Utils\Strings; -/** - * @see \Rector\Core\Tests\Util\StaticRectorStringsTest - */ final class StaticRectorStrings { /** @@ -47,7 +44,7 @@ public static function isInArrayInsensitive(string $checkedItem, array $array) : public static function removePrefixes(string $value, array $prefixesToRemove) : string { foreach ($prefixesToRemove as $prefixToRemove) { - if (\RectorPrefix20210529\Nette\Utils\Strings::startsWith($value, $prefixToRemove)) { + if (\str_starts_with($value, $prefixToRemove)) { $value = \RectorPrefix20210529\Nette\Utils\Strings::substring($value, \RectorPrefix20210529\Nette\Utils\Strings::length($prefixToRemove)); } } @@ -59,7 +56,7 @@ public static function removePrefixes(string $value, array $prefixesToRemove) : public static function removeSuffixes(string $value, array $suffixesToRemove) : string { foreach ($suffixesToRemove as $suffixToRemove) { - if (\RectorPrefix20210529\Nette\Utils\Strings::endsWith($value, $suffixToRemove)) { + if (\str_ends_with($value, $suffixToRemove)) { $value = \RectorPrefix20210529\Nette\Utils\Strings::substring($value, 0, -\RectorPrefix20210529\Nette\Utils\Strings::length($suffixToRemove)); } } diff --git a/vendor/autoload.php b/vendor/autoload.php index 332936121862..ea00c93be5d2 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f::getLoader(); +return ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 5f87a119f0d2..a4c66bfe2295 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f +class ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50 { private static $loader; @@ -22,15 +22,15 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50', '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\ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitc62b7e8320547054a32f5ac6306a7e50::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { @@ -42,19 +42,19 @@ public static function getLoader() $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitc62b7e8320547054a32f5ac6306a7e50::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire337f58b2e3b250842c3babd1f071fc6f($fileIdentifier, $file); + composerRequirec62b7e8320547054a32f5ac6306a7e50($fileIdentifier, $file); } return $loader; } } -function composerRequire337f58b2e3b250842c3babd1f071fc6f($fileIdentifier, $file) +function composerRequirec62b7e8320547054a32f5ac6306a7e50($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index d703e5036680..23e53038a8c6 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f +class ComposerStaticInitc62b7e8320547054a32f5ac6306a7e50 { public static $files = array ( 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', @@ -3824,9 +3824,9 @@ class ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitc62b7e8320547054a32f5ac6306a7e50::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitc62b7e8320547054a32f5ac6306a7e50::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitc62b7e8320547054a32f5ac6306a7e50::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index 9508e285a082..db74c71a0642 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -21,8 +21,8 @@ if (!class_exists('CheckoutEntityFactory', false) && !interface_exists('CheckoutEntityFactory', false) && !trait_exists('CheckoutEntityFactory', false)) { spl_autoload_call('RectorPrefix20210529\CheckoutEntityFactory'); } -if (!class_exists('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', false) && !interface_exists('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', false) && !trait_exists('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', false)) { - spl_autoload_call('RectorPrefix20210529\ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f'); +if (!class_exists('ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50', false) && !interface_exists('ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50', false) && !trait_exists('ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50', false)) { + spl_autoload_call('RectorPrefix20210529\ComposerAutoloaderInitc62b7e8320547054a32f5ac6306a7e50'); } if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) { spl_autoload_call('RectorPrefix20210529\Doctrine\Inflector\Inflector'); @@ -3320,9 +3320,9 @@ function print_node() { return \RectorPrefix20210529\print_node(...func_get_args()); } } -if (!function_exists('composerRequire337f58b2e3b250842c3babd1f071fc6f')) { - function composerRequire337f58b2e3b250842c3babd1f071fc6f() { - return \RectorPrefix20210529\composerRequire337f58b2e3b250842c3babd1f071fc6f(...func_get_args()); +if (!function_exists('composerRequirec62b7e8320547054a32f5ac6306a7e50')) { + function composerRequirec62b7e8320547054a32f5ac6306a7e50() { + return \RectorPrefix20210529\composerRequirec62b7e8320547054a32f5ac6306a7e50(...func_get_args()); } } if (!function_exists('parseArgs')) { diff --git a/vendor/symfony/string/AbstractString.php b/vendor/symfony/string/AbstractString.php index 76c483b9b6c6..dbae24454809 100644 --- a/vendor/symfony/string/AbstractString.php +++ b/vendor/symfony/string/AbstractString.php @@ -25,7 +25,7 @@ * * @throws ExceptionInterface */ -abstract class AbstractString implements \Stringable, \JsonSerializable +abstract class AbstractString implements \JsonSerializable { public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER; public const PREG_SET_ORDER = \PREG_SET_ORDER; diff --git a/vendor/symfony/string/LazyString.php b/vendor/symfony/string/LazyString.php index 3056d5b3359b..7d1f93dd9e67 100644 --- a/vendor/symfony/string/LazyString.php +++ b/vendor/symfony/string/LazyString.php @@ -15,7 +15,7 @@ * * @author Nicolas Grekas */ -class LazyString implements \Stringable, \JsonSerializable +class LazyString implements \JsonSerializable { private $value; /**