From 6e99aeb054999fd1afd530f4a77106827e5d7ea8 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 12 Aug 2023 23:15:09 +0000 Subject: [PATCH] Updated Rector to commit 3e9de3dd3f4dc6f88bf89b9e8879b26380d69e41 https://github.com/rectorphp/rector-src/commit/3e9de3dd3f4dc6f88bf89b9e8879b26380d69e41 rebuild docs --- docs/rector_rules_overview.md | 1091 --------------------------- src/Application/VersionResolver.php | 4 +- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +- vendor/composer/autoload_static.php | 8 +- 5 files changed, 12 insertions(+), 1103 deletions(-) diff --git a/docs/rector_rules_overview.md b/docs/rector_rules_overview.md index ed961cdba91..9d8c06e93d4 100644 --- a/docs/rector_rules_overview.md +++ b/docs/rector_rules_overview.md @@ -70,25 +70,6 @@ This Rector adds new default arguments in calls of defined methods and class typ - class: [`Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector`](../rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php) -```php -ruleWithConfiguration(ArgumentAdderRector::class, [ - new ArgumentAdder('SomeExampleClass', 'someMethod', 0, 'someArgument', true, new ObjectType('SomeType')), - ]); -}; -``` - -↓ - ```diff $someObject = new SomeExampleClass; -$someObject->someMethod(); @@ -113,24 +94,6 @@ Streamline the operator arguments of version_compare function - class: [`Rector\Arguments\Rector\FuncCall\FunctionArgumentDefaultValueReplacerRector`](../rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php) -```php -ruleWithConfiguration(FunctionArgumentDefaultValueReplacerRector::class, [ - new ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'gte', 'ge'), - ]); -}; -``` - -↓ - ```diff -version_compare(PHP_VERSION, '5.6', 'gte'); +version_compare(PHP_VERSION, '5.6', 'ge'); @@ -146,24 +109,6 @@ Remove parameter of method call - class: [`Rector\Arguments\Rector\MethodCall\RemoveMethodCallParamRector`](../rules/Arguments/Rector/MethodCall/RemoveMethodCallParamRector.php) -```php -ruleWithConfiguration(RemoveMethodCallParamRector::class, [ - new RemoveMethodCallParam('Caller', 'process', 1), - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -185,24 +130,6 @@ Replaces defined map of arguments in defined methods and their calls. - class: [`Rector\Arguments\Rector\ClassMethod\ReplaceArgumentDefaultValueRector`](../rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php) -```php -ruleWithConfiguration(ReplaceArgumentDefaultValueRector::class, [ - new ReplaceArgumentDefaultValue('SomeClass', 'someMethod', 0, 'SomeClass::OLD_CONSTANT', false), - ]); -}; -``` - -↓ - ```diff $someObject = new SomeClass; -$someObject->someMethod(SomeClass::OLD_CONSTANT); @@ -219,28 +146,6 @@ Reorder arguments in function calls - class: [`Rector\Arguments\Rector\FuncCall\SwapFuncCallArgumentsRector`](../rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php) -```php -ruleWithConfiguration(SwapFuncCallArgumentsRector::class, [ - new SwapFuncCallArguments('some_function', [ - 2, - 1, - 0, - ]), - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -2301,23 +2206,6 @@ Remove annotation by names - class: [`Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector`](../rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php) -```php -ruleWithConfiguration(RemoveAnnotationRector::class, [ - 'method', - ]); -}; -``` - -↓ - ```diff -/** - * @method getName() @@ -3738,24 +3626,6 @@ Replace string class names by ::class constant - class: [`Rector\Php55\Rector\String_\StringClassNameToClassConstantRector`](../rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php) -```php -ruleWithConfiguration(StringClassNameToClassConstantRector::class, [ - 'ClassName', - 'AnotherClassName', - ]); -}; -``` - -↓ - ```diff class AnotherClass { @@ -4578,23 +4448,6 @@ Add "_" as thousands separator in numbers for higher or equals to limitValue con - class: [`Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector`](../rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php) -```php -ruleWithConfiguration(AddLiteralSeparatorToNumberRector::class, [ - AddLiteralSeparatorToNumberRector::LIMIT_VALUE => 1000000, - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -4847,24 +4700,6 @@ Change annotation to attribute - class: [`Rector\Php80\Rector\Class_\AnnotationToAttributeRector`](../rules/Php80/Rector/Class_/AnnotationToAttributeRector.php) -```php -ruleWithConfiguration(AnnotationToAttributeRector::class, [ - new AnnotationToAttribute('Symfony\Component\Routing\Annotation\Route'), - ]); -}; -``` - -↓ - ```diff use Symfony\Component\Routing\Annotation\Route; @@ -4954,23 +4789,6 @@ Change simple property init and assign to constructor promotion - class: [`Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector`](../rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php) -```php -ruleWithConfiguration(ClassPropertyAssignToConstructorPromotionRector::class, [ - ClassPropertyAssignToConstructorPromotionRector::INLINE_PUBLIC => false, - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -5053,30 +4871,6 @@ Changed nested annotations to attributes - class: [`Rector\Php80\Rector\Property\NestedAnnotationToAttributeRector`](../rules/Php80/Rector/Property/NestedAnnotationToAttributeRector.php) -```php -ruleWithConfiguration(NestedAnnotationToAttributeRector::class, [ - [ - new NestedAnnotationToAttribute([ - new AnnotationPropertyToAttributeClass('Doctrine\ORM\Mapping\JoinColumn', 'joinColumns', false), - new AnnotationPropertyToAttributeClass('Doctrine\ORM\Mapping\InverseJoinColumn', 'inverseJoinColumns', false), - ], 'Doctrine\ORM\Mapping\JoinTable', false), - ], - ]); -}; -``` - -↓ - ```diff use Doctrine\ORM\Mapping as ORM; @@ -5450,25 +5244,6 @@ Add SensitiveParameter attribute to method and function configured parameters - class: [`Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector`](../rules/Php82/Rector/Param/AddSensitiveParameterAttributeRector.php) -```php -ruleWithConfiguration(AddSensitiveParameterAttributeRector::class, [ - AddSensitiveParameterAttributeRector::SENSITIVE_PARAMETERS => [ - 'password', - ], - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -5625,26 +5400,6 @@ Removes defined arguments in defined methods and their calls. - class: [`Rector\Removing\Rector\ClassMethod\ArgumentRemoverRector`](../rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php) -```php -ruleWithConfiguration(ArgumentRemoverRector::class, [ - new ArgumentRemover('ExampleClass', 'someMethod', 0, [ - true, - ]), - ]); -}; -``` - -↓ - ```diff $someObject = new SomeClass; -$someObject->someMethod(true); @@ -5661,24 +5416,6 @@ Remove argument by position by function name - class: [`Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector`](../rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php) -```php -ruleWithConfiguration(RemoveFuncCallArgRector::class, [ - new RemoveFuncCallArg('remove_last_arg', 1), - ]); -}; -``` - -↓ - ```diff -remove_last_arg(1, 2); +remove_last_arg(1); @@ -5694,23 +5431,6 @@ Remove function - class: [`Rector\Removing\Rector\FuncCall\RemoveFuncCallRector`](../rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php) -```php -ruleWithConfiguration(RemoveFuncCallRector::class, [ - 'var_dump', - ]); -}; -``` - -↓ - ```diff -$x = 'something'; -var_dump($x); @@ -5727,23 +5447,6 @@ Removes interfaces usage from class. - class: [`Rector\Removing\Rector\Class_\RemoveInterfacesRector`](../rules/Removing/Rector/Class_/RemoveInterfacesRector.php) -```php -ruleWithConfiguration(RemoveInterfacesRector::class, [ - 'SomeInterface', - ]); -}; -``` - -↓ - ```diff -class SomeClass implements SomeInterface +class SomeClass @@ -5761,23 +5464,6 @@ Remove specific traits from code - class: [`Rector\Removing\Rector\Class_\RemoveTraitUseRector`](../rules/Removing/Rector/Class_/RemoveTraitUseRector.php) -```php -ruleWithConfiguration(RemoveTraitUseRector::class, [ - 'TraitNameToRemove', - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -5797,26 +5483,6 @@ Replaces defined Pseudo_Namespaces by Namespace\Ones. - class: [`Rector\Renaming\Rector\FileWithoutNamespace\PseudoNamespaceToNamespaceRector`](../rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php) -```php -ruleWithConfiguration(PseudoNamespaceToNamespaceRector::class, [ - new PseudoNamespaceToNamespace('Some_', [ - 'Some_Class_To_Keep', - ]), - ]); -}; -``` - -↓ - ```diff -/** @var Some_Chicken $someService */ -$someService = new Some_Chicken; @@ -5835,24 +5501,6 @@ Turns defined annotations above properties and methods to their new values. - class: [`Rector\Renaming\Rector\ClassMethod\RenameAnnotationRector`](../rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php) -```php -ruleWithConfiguration(RenameAnnotationRector::class, [ - new RenameAnnotationByType('PHPUnit\Framework\TestCase', 'test', 'scenario'), - ]); -}; -``` - -↓ - ```diff use PHPUnit\Framework\TestCase; @@ -5878,26 +5526,6 @@ Replaces defined class constants in their calls. - class: [`Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector`](../rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php) -```php -ruleWithConfiguration(RenameClassConstFetchRector::class, [ - new RenameClassConstFetch('SomeClass', 'OLD_CONSTANT', 'NEW_CONSTANT'), - new RenameClassAndConstFetch('SomeClass', 'OTHER_OLD_CONSTANT', 'DifferentClass', 'NEW_CONSTANT'), - ]); -}; -``` - -↓ - ```diff -$value = SomeClass::OLD_CONSTANT; -$value = SomeClass::OTHER_OLD_CONSTANT; @@ -5915,23 +5543,6 @@ Replaces defined classes by new ones. - class: [`Rector\Renaming\Rector\Name\RenameClassRector`](../rules/Renaming/Rector/Name/RenameClassRector.php) -```php -ruleWithConfiguration(RenameClassRector::class, [ - 'App\SomeOldClass' => 'App\SomeNewClass', - ]); -}; -``` - -↓ - ```diff namespace App; @@ -5959,24 +5570,6 @@ Replace constant by new ones - class: [`Rector\Renaming\Rector\ConstFetch\RenameConstantRector`](../rules/Renaming/Rector/ConstFetch/RenameConstantRector.php) -```php -ruleWithConfiguration(RenameConstantRector::class, [ - 'MYSQL_ASSOC' => 'MYSQLI_ASSOC', - 'OLD_CONSTANT' => 'NEW_CONSTANT', - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -5998,23 +5591,6 @@ Turns defined function call new one. - class: [`Rector\Renaming\Rector\FuncCall\RenameFunctionRector`](../rules/Renaming/Rector/FuncCall/RenameFunctionRector.php) -```php -ruleWithConfiguration(RenameFunctionRector::class, [ - 'view' => 'Laravel\Templating\render', - ]); -}; -``` - -↓ - ```diff -view("...", []); +Laravel\Templating\render("...", []); @@ -6030,24 +5606,6 @@ Turns method names to new ones. - class: [`Rector\Renaming\Rector\MethodCall\RenameMethodRector`](../rules/Renaming/Rector/MethodCall/RenameMethodRector.php) -```php -ruleWithConfiguration(RenameMethodRector::class, [ - new MethodCallRename('SomeExampleClass', 'oldMethod', 'newMethod'), - ]); -}; -``` - -↓ - ```diff $someObject = new SomeExampleClass; -$someObject->oldMethod(); @@ -6064,24 +5622,6 @@ Replaces defined old properties by new ones. - class: [`Rector\Renaming\Rector\PropertyFetch\RenamePropertyRector`](../rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php) -```php -ruleWithConfiguration(RenamePropertyRector::class, [ - new RenameProperty('SomeClass', 'someOldProperty', 'someNewProperty'), - ]); -}; -``` - -↓ - ```diff -$someObject->someOldProperty; +$someObject->someNewProperty; @@ -6097,24 +5637,6 @@ Turns method names to new ones. - class: [`Rector\Renaming\Rector\StaticCall\RenameStaticMethodRector`](../rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php) -```php -ruleWithConfiguration(RenameStaticMethodRector::class, [ - new RenameStaticMethod('SomeClass', 'oldMethod', 'AnotherExampleClass', 'newStaticMethod'), - ]); -}; -``` - -↓ - ```diff -SomeClass::oldStaticMethod(); +AnotherExampleClass::newStaticMethod(); @@ -6130,23 +5652,6 @@ Change string value - class: [`Rector\Renaming\Rector\String_\RenameStringRector`](../rules/Renaming/Rector/String_/RenameStringRector.php) -```php -ruleWithConfiguration(RenameStringRector::class, [ - 'ROLE_PREVIOUS_ADMIN' => 'IS_IMPERSONATOR', - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -6170,23 +5675,6 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\BooleansInConditi - class: [`Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector`](../rules/Strict/Rector/BooleanNot/BooleanInBooleanNotRuleFixerRector.php) -```php -ruleWithConfiguration(BooleanInBooleanNotRuleFixerRector::class, [ - BooleanInBooleanNotRuleFixerRector::TREAT_AS_NON_EMPTY => true, - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -6212,23 +5700,6 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\BooleansInConditi - class: [`Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector`](../rules/Strict/Rector/If_/BooleanInIfConditionRuleFixerRector.php) -```php -ruleWithConfiguration(BooleanInIfConditionRuleFixerRector::class, [ - BooleanInIfConditionRuleFixerRector::TREAT_AS_NON_EMPTY => false, - ]); -}; -``` - -↓ - ```diff final class NegatedString { @@ -6254,23 +5725,6 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\BooleansInConditi - class: [`Rector\Strict\Rector\Ternary\BooleanInTernaryOperatorRuleFixerRector`](../rules/Strict/Rector/Ternary/BooleanInTernaryOperatorRuleFixerRector.php) -```php -ruleWithConfiguration(BooleanInTernaryOperatorRuleFixerRector::class, [ - BooleanInTernaryOperatorRuleFixerRector::TREAT_AS_NON_EMPTY => false, - ]); -}; -``` - -↓ - ```diff final class ArrayCompare { @@ -6292,23 +5746,6 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\DisallowedConstru - class: [`Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector`](../rules/Strict/Rector/Empty_/DisallowedEmptyRuleFixerRector.php) -```php -ruleWithConfiguration(DisallowedEmptyRuleFixerRector::class, [ - DisallowedEmptyRuleFixerRector::TREAT_AS_NON_EMPTY => false, - ]); -}; -``` - -↓ - ```diff final class SomeEmptyArray { @@ -6330,23 +5767,6 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\DisallowedConstru - class: [`Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector`](../rules/Strict/Rector/Ternary/DisallowedShortTernaryRuleFixerRector.php) -```php -ruleWithConfiguration(DisallowedShortTernaryRuleFixerRector::class, [ - DisallowedShortTernaryRuleFixerRector::TREAT_AS_NON_EMPTY => false, - ]); -}; -``` - -↓ - ```diff final class ShortTernaryArray { @@ -6370,23 +5790,6 @@ Add the `AllowDynamicProperties` attribute to all classes - class: [`Rector\Transform\Rector\Class_\AddAllowDynamicPropertiesAttributeRector`](../rules/Transform/Rector/Class_/AddAllowDynamicPropertiesAttributeRector.php) -```php -ruleWithConfiguration(AddAllowDynamicPropertiesAttributeRector::class, [ - 'Example\*', - ]); -}; -``` - -↓ - ```diff namespace Example\Domain; @@ -6406,23 +5809,6 @@ Add interface by used trait - class: [`Rector\Transform\Rector\Class_\AddInterfaceByTraitRector`](../rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php) -```php -ruleWithConfiguration(AddInterfaceByTraitRector::class, [ - 'SomeTrait' => 'SomeInterface', - ]); -}; -``` - -↓ - ```diff -class SomeClass +class SomeClass implements SomeInterface @@ -6441,26 +5827,6 @@ Replace key value on specific attribute to class constant - class: [`Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector`](../rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php) -```php -ruleWithConfiguration(AttributeKeyToClassConstFetchRector::class, [ - new AttributeKeyToClassConstFetch('Doctrine\ORM\Mapping\Column', 'type', 'Doctrine\DBAL\Types\Types', [ - 'STRING', - ]), - ]); -}; -``` - -↓ - ```diff use Doctrine\ORM\Mapping\Column; +use Doctrine\DBAL\Types\Types; @@ -6483,23 +5849,6 @@ Changes use of function calls to use constants - class: [`Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector`](../rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php) -```php -ruleWithConfiguration(FuncCallToConstFetchRector::class, [ - 'php_sapi_name' => 'PHP_SAPI', - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -6521,24 +5870,6 @@ Turns defined function calls to local method calls. - class: [`Rector\Transform\Rector\FuncCall\FuncCallToMethodCallRector`](../rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php) -```php -ruleWithConfiguration(FuncCallToMethodCallRector::class, [ - new FuncCallToMethodCall('view', 'Namespaced\SomeRenderer', 'render'), - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -6570,25 +5901,6 @@ Change configured function calls to new Instance - class: [`Rector\Transform\Rector\FuncCall\FuncCallToNewRector`](../rules/Transform/Rector/FuncCall/FuncCallToNewRector.php) -```php -ruleWithConfiguration(FuncCallToNewRector::class, [ - 'collection' => [ - 'Collection', - ], - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -6610,24 +5922,6 @@ Turns defined function call to static method call. - class: [`Rector\Transform\Rector\FuncCall\FuncCallToStaticCallRector`](../rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php) -```php -ruleWithConfiguration(FuncCallToStaticCallRector::class, [ - new FuncCallToStaticCall('view', 'SomeStaticClass', 'render'), - ]); -}; -``` - -↓ - ```diff -view("...", []); +SomeClass::render("...", []); @@ -6643,23 +5937,6 @@ Merges old interface to a new one, that already has its methods - class: [`Rector\Transform\Rector\Class_\MergeInterfacesRector`](../rules/Transform/Rector/Class_/MergeInterfacesRector.php) -```php -ruleWithConfiguration(MergeInterfacesRector::class, [ - 'SomeOldInterface' => 'SomeInterface', - ]); -}; -``` - -↓ - ```diff -class SomeClass implements SomeInterface, SomeOldInterface +class SomeClass implements SomeInterface @@ -6677,24 +5954,6 @@ Change method call to function call - class: [`Rector\Transform\Rector\MethodCall\MethodCallToFuncCallRector`](../rules/Transform/Rector/MethodCall/MethodCallToFuncCallRector.php) -```php -ruleWithConfiguration(MethodCallToFuncCallRector::class, [ - new MethodCallToFuncCall('SomeClass', 'render', 'view'), - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -6716,23 +5975,6 @@ Turns method call `"$this->something()"` to property fetch "$this->something" - class: [`Rector\Transform\Rector\MethodCall\MethodCallToPropertyFetchRector`](../rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php) -```php -ruleWithConfiguration(MethodCallToPropertyFetchRector::class, [ - 'someMethod' => 'someProperty', - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -6754,24 +5996,6 @@ Change method call to desired static call - class: [`Rector\Transform\Rector\MethodCall\MethodCallToStaticCallRector`](../rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php) -```php -ruleWithConfiguration(MethodCallToStaticCallRector::class, [ - new MethodCallToStaticCall('AnotherDependency', 'process', 'StaticCaller', 'anotherMethod'), - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -6800,24 +6024,6 @@ Change new Object to static call - class: [`Rector\Transform\Rector\New_\NewToStaticCallRector`](../rules/Transform/Rector/New_/NewToStaticCallRector.php) -```php -ruleWithConfiguration(NewToStaticCallRector::class, [ - new NewToStaticCall('Cookie', 'Cookie', 'create'), - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -6839,26 +6045,6 @@ Replaces parent class to specific traits - class: [`Rector\Transform\Rector\Class_\ParentClassToTraitsRector`](../rules/Transform/Rector/Class_/ParentClassToTraitsRector.php) -```php -ruleWithConfiguration(ParentClassToTraitsRector::class, [ - new ParentClassToTraits('Nette\Object', [ - 'Nette\SmartObject', - ]), - ]); -}; -``` - -↓ - ```diff -class SomeClass extends Nette\Object +class SomeClass @@ -6877,24 +6063,6 @@ Turns property assign of specific type and property name to method call - class: [`Rector\Transform\Rector\Assign\PropertyAssignToMethodCallRector`](../rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php) -```php -ruleWithConfiguration(PropertyAssignToMethodCallRector::class, [ - new PropertyAssignToMethodCall('SomeClass', 'oldProperty', 'newMethodCall'), - ]); -}; -``` - -↓ - ```diff $someObject = new SomeClass; -$someObject->oldProperty = false; @@ -6911,28 +6079,6 @@ Replaces properties assign calls be defined methods. - class: [`Rector\Transform\Rector\Assign\PropertyFetchToMethodCallRector`](../rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php) -```php -ruleWithConfiguration(PropertyFetchToMethodCallRector::class, [ - new PropertyFetchToMethodCall('SomeObject', 'property', 'getProperty', 'setProperty', [ - ]), - new PropertyFetchToMethodCall('SomeObject', 'bareProperty', 'getConfig', [ - 'someArg', - ]), - ]); -}; -``` - -↓ - ```diff -$result = $object->property; -$object->property = $value; @@ -6953,24 +6099,6 @@ Changes method calls in child of specific types to defined property method call - class: [`Rector\Transform\Rector\MethodCall\ReplaceParentCallByPropertyCallRector`](../rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php) -```php -ruleWithConfiguration(ReplaceParentCallByPropertyCallRector::class, [ - new ReplaceParentCallByPropertyCall('SomeTypeToReplace', 'someMethodCall', 'someProperty'), - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -6992,24 +6120,6 @@ Add #[\ReturnTypeWillChange] attribute to configured instanceof class with metho - class: [`Rector\Transform\Rector\ClassMethod\ReturnTypeWillChangeRector`](../rules/Transform/Rector/ClassMethod/ReturnTypeWillChangeRector.php) -```php -ruleWithConfiguration(ReturnTypeWillChangeRector::class, [ - new ClassMethodReference('ArrayAccess', 'offsetGet'), - ]); -}; -``` - -↓ - ```diff class SomeClass implements ArrayAccess { @@ -7030,24 +6140,6 @@ Turns static call to function call. - class: [`Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector`](../rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php) -```php -ruleWithConfiguration(StaticCallToFuncCallRector::class, [ - new StaticCallToFuncCall('OldClass', 'oldMethod', 'new_function'), - ]); -}; -``` - -↓ - ```diff -OldClass::oldMethod("args"); +new_function("args"); @@ -7063,24 +6155,6 @@ Change static call to service method via constructor injection - class: [`Rector\Transform\Rector\StaticCall\StaticCallToMethodCallRector`](../rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php) -```php -ruleWithConfiguration(StaticCallToMethodCallRector::class, [ - new StaticCallToMethodCall('Nette\Utils\FileSystem', 'write', 'App\Custom\SmartFileSystem', 'dumpFile'), - ]); -}; -``` - -↓ - ```diff -use Nette\Utils\FileSystem; +use App\Custom\SmartFileSystem; @@ -7115,24 +6189,6 @@ Change static call to new instance - class: [`Rector\Transform\Rector\StaticCall\StaticCallToNewRector`](../rules/Transform/Rector/StaticCall/StaticCallToNewRector.php) -```php -ruleWithConfiguration(StaticCallToNewRector::class, [ - new StaticCallToNew('JsonResponse', 'create'), - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -7154,24 +6210,6 @@ Changes strings to specific constants - class: [`Rector\Transform\Rector\String_\StringToClassConstantRector`](../rules/Transform/Rector/String_/StringToClassConstantRector.php) -```php -ruleWithConfiguration(StringToClassConstantRector::class, [ - new StringToClassConstant('compiler.post_dump', 'Yet\AnotherClass', 'CONSTANT'), - ]); -}; -``` - -↓ - ```diff final class SomeSubscriber { @@ -7193,24 +6231,6 @@ Wrap return value of specific method - class: [`Rector\Transform\Rector\ClassMethod\WrapReturnRector`](../rules/Transform/Rector/ClassMethod/WrapReturnRector.php) -```php -ruleWithConfiguration(WrapReturnRector::class, [ - new WrapReturn('SomeClass', 'getItem', true), - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -7298,25 +6318,6 @@ Add param types where needed - class: [`Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector`](../rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php) -```php -ruleWithConfiguration(AddParamTypeDeclarationRector::class, [ - new AddParamTypeDeclaration('SomeClass', 'process', 0, new StringType()), - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -7381,25 +6382,6 @@ Add type to property by added rules, mostly public/property by parent type - class: [`Rector\TypeDeclaration\Rector\Property\AddPropertyTypeDeclarationRector`](../rules/TypeDeclaration/Rector/Property/AddPropertyTypeDeclarationRector.php) -```php -ruleWithConfiguration(AddPropertyTypeDeclarationRector::class, [ - new AddPropertyTypeDeclaration('ParentClass', 'name', new StringType()), - ]); -}; -``` - -↓ - ```diff class SomeClass extends ParentClass { @@ -7464,26 +6446,6 @@ Changes defined return typehint of method and class. - class: [`Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector`](../rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php) -```php -ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [ - new AddReturnTypeDeclaration('SomeClass', 'getData', new ArrayType(new MixedType(), new MixedType())), - ]); -}; -``` - -↓ - ```diff class SomeClass { @@ -8037,23 +6999,6 @@ Add typed property from assigned types - class: [`Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector`](../rules/TypeDeclaration/Rector/Property/TypedPropertyFromAssignsRector.php) -```php -ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [ - TypedPropertyFromAssignsRector::INLINE_PUBLIC => false, - ]); -}; -``` - -↓ - ```diff final class SomeClass { @@ -8189,24 +7134,6 @@ Change visibility of constant from parent class. - class: [`Rector\Visibility\Rector\ClassConst\ChangeConstantVisibilityRector`](../rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php) -```php -ruleWithConfiguration(ChangeConstantVisibilityRector::class, [ - new ChangeConstantVisibility('ParentObject', 'SOME_CONSTANT', 2), - ]); -}; -``` - -↓ - ```diff class FrameworkClass { @@ -8230,24 +7157,6 @@ Change visibility of method from parent class. - class: [`Rector\Visibility\Rector\ClassMethod\ChangeMethodVisibilityRector`](../rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php) -```php -ruleWithConfiguration(ChangeMethodVisibilityRector::class, [ - new ChangeMethodVisibility('FrameworkClass', 'someMethod', 2), - ]); -}; -``` - -↓ - ```diff class FrameworkClass { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 15a3fa6cdf7..688fff8e857 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '73eea785622200d731f9d8188323380581e5dcf2'; + public const PACKAGE_VERSION = '3e9de3dd3f4dc6f88bf89b9e8879b26380d69e41'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-08-13 01:01:11'; + public const RELEASE_DATE = '2023-08-13 01:11:04'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index fb8fb6d9cbc..838751648cd 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit8d32175794c2305f48c763bcc3562db6::getLoader(); +return ComposerAutoloaderInit5804f5f0b5ec9833a1f4f1e9fb639c03::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 05a0098623e..1421ebdb1ec 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit8d32175794c2305f48c763bcc3562db6 +class ComposerAutoloaderInit5804f5f0b5ec9833a1f4f1e9fb639c03 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit8d32175794c2305f48c763bcc3562db6 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit8d32175794c2305f48c763bcc3562db6', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit5804f5f0b5ec9833a1f4f1e9fb639c03', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit8d32175794c2305f48c763bcc3562db6', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit5804f5f0b5ec9833a1f4f1e9fb639c03', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit8d32175794c2305f48c763bcc3562db6::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit5804f5f0b5ec9833a1f4f1e9fb639c03::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit8d32175794c2305f48c763bcc3562db6::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit5804f5f0b5ec9833a1f4f1e9fb639c03::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index e59cb923b1c..8ab28d3cec3 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit8d32175794c2305f48c763bcc3562db6 +class ComposerStaticInit5804f5f0b5ec9833a1f4f1e9fb639c03 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -2959,9 +2959,9 @@ class ComposerStaticInit8d32175794c2305f48c763bcc3562db6 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit8d32175794c2305f48c763bcc3562db6::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit8d32175794c2305f48c763bcc3562db6::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit8d32175794c2305f48c763bcc3562db6::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit5804f5f0b5ec9833a1f4f1e9fb639c03::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit5804f5f0b5ec9833a1f4f1e9fb639c03::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit5804f5f0b5ec9833a1f4f1e9fb639c03::$classMap; }, null, ClassLoader::class); }